Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit 2fd4c58

Browse files
committed
Merge pull request #70 from mozilla-servo/rustup-20140528
Upgrade Rust.
2 parents 29b9303 + 444520b commit 2fd4c58

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

platform/linux/surface.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use opengles::glx::{GLX_RGBA_BIT, GLX_WINDOW_BIT, GLX_RENDER_TYPE, GLX_DOUBLEBUF
2525
use opengles::glx::{GLX_VENDOR};
2626
use opengles::gl2::NO_ERROR;
2727
use opengles::gl2;
28-
use std::cast;
2928
use std::c_str::CString;
29+
use std::mem;
3030
use std::ptr;
3131
use xlib::xlib::{Display, Pixmap, XCreateGC, XCreateImage, XCreatePixmap, XDefaultScreen};
3232
use xlib::xlib::{XDisplayString, XFreePixmap, XGetGeometry, XOpenDisplay, XPutImage, XRootWindow};
@@ -76,7 +76,7 @@ impl NativeCompositingGraphicsContext {
7676
/// FIXME(pcwalton): It would be more robust to actually have the compositor pass the visual.
7777
fn compositor_visual_info(display: *Display) -> (*XVisualInfo, Option<GLXFBConfig>) {
7878
unsafe {
79-
let glx_display = cast::transmute(display);
79+
let glx_display = mem::transmute(display);
8080

8181
// CONSIDER:
8282
// In skia, they compute the GLX_ALPHA_SIZE minimum and request
@@ -95,7 +95,7 @@ impl NativeCompositingGraphicsContext {
9595
let configs = glXChooseFBConfig(glx_display, screen,
9696
&fbconfig_attributes[0], &mut number_of_configs);
9797
let glXGetClientString: extern "C" fn(*Display, c_int) -> *c_char =
98-
cast::transmute(glXGetProcAddress(cast::transmute(&"glXGetClientString\x00"[0])));
98+
mem::transmute(glXGetProcAddress(mem::transmute(&"glXGetClientString\x00"[0])));
9999
assert!(glXGetClientString as *c_void != ptr::null());
100100
let glx_cli_vendor_c_str = CString::new(glXGetClientString(display, GLX_VENDOR), false);
101101
let glx_cli_vendor = match glx_cli_vendor_c_str.as_str() { Some(s) => s,
@@ -106,15 +106,15 @@ impl NativeCompositingGraphicsContext {
106106
// with a full set of 32 bits.
107107
for i in range(0, number_of_configs as int) {
108108
let config = *configs.offset(i);
109-
let visual_info : *XVisualInfo = cast::transmute(glXGetVisualFromFBConfig(glx_display, config));
109+
let visual_info : *XVisualInfo = mem::transmute(glXGetVisualFromFBConfig(glx_display, config));
110110
if (*visual_info).depth == 32 {
111111
return (visual_info, Some(config))
112112
}
113113
}
114114
} else if number_of_configs != 0 {
115115
let fbconfig = *configs.offset(0);
116116
let vi = glXGetVisualFromFBConfig(glx_display, fbconfig);
117-
return (cast::transmute(vi), Some(fbconfig));
117+
return (mem::transmute(vi), Some(fbconfig));
118118
}
119119
fail!("Unable to locate a GLX FB configuration that supports RGBA.");
120120
}
@@ -151,11 +151,9 @@ impl NativeGraphicsMetadata {
151151
let display = descriptor.display.with_c_str(|c_str| {
152152
XOpenDisplay(c_str)
153153
});
154-
155154
if display.is_null() {
156155
fail!("XOpenDisplay() failed!");
157156
}
158-
159157
NativeGraphicsMetadata {
160158
display: display,
161159
}
@@ -166,7 +164,7 @@ impl NativeGraphicsMetadata {
166164
/// A sendable form of the X display string.
167165
#[deriving(Clone, Decodable, Encodable)]
168166
pub struct NativeGraphicsMetadataDescriptor {
169-
display: ~str,
167+
display: String,
170168
}
171169

172170
impl NativeGraphicsMetadataDescriptor {
@@ -245,7 +243,7 @@ impl NativeSurfaceMethods for NativeSurface {
245243
0
246244
];
247245

248-
let glx_display = cast::transmute(native_context.display);
246+
let glx_display = mem::transmute(native_context.display);
249247

250248
let glx_pixmap = glXCreatePixmap(glx_display,
251249
native_context.framebuffer_configuration.expect(
@@ -254,11 +252,11 @@ impl NativeSurfaceMethods for NativeSurface {
254252
&pixmap_attributes[0]);
255253

256254
let glXBindTexImageEXT: extern "C" fn(*Display, GLXDrawable, c_int, *c_int) =
257-
cast::transmute(glXGetProcAddress(cast::transmute(&"glXBindTexImageEXT\x00"[0])));
255+
mem::transmute(glXGetProcAddress(mem::transmute(&"glXBindTexImageEXT\x00"[0])));
258256
assert!(glXBindTexImageEXT as *c_void != ptr::null());
259257
let _bound = texture.bind();
260258
glXBindTexImageEXT(native_context.display,
261-
cast::transmute(glx_pixmap),
259+
mem::transmute(glx_pixmap),
262260
GLX_FRONT_EXT,
263261
ptr::null());
264262
assert_eq!(gl2::get_error(), NO_ERROR);
@@ -283,7 +281,7 @@ impl NativeSurfaceMethods for NativeSurface {
283281
let mut border_width = 0;
284282
let mut depth = 0;
285283
let _ = XGetGeometry(graphics_context.display,
286-
cast::transmute(pixmap),
284+
mem::transmute(pixmap),
287285
&mut root_window,
288286
&mut x,
289287
&mut y,
@@ -298,7 +296,7 @@ impl NativeSurfaceMethods for NativeSurface {
298296
depth,
299297
ZPixmap,
300298
0,
301-
cast::transmute(&data[0]),
299+
mem::transmute(&data[0]),
302300
width as c_uint,
303301
height as c_uint,
304302
32,

rendergl.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -419,15 +419,3 @@ pub fn render_scene(render_context: RenderContext, scene: &Scene) {
419419
// Render the root layer.
420420
render_layer(render_context, transform, scene.size, scene.root.clone());
421421
}
422-
423-
#[cfg(debug)]
424-
fn maybe_get_error() {
425-
if get_error() != NO_ERROR {
426-
fail!("GL error: {:d}", get_error() as int);
427-
}
428-
}
429-
430-
#[cfg(not(debug))]
431-
fn maybe_get_error() {
432-
// do nothing
433-
}

texturegl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Zero for Texture {
8787

8888
/// Encapsulates a bound texture. This ensures that the texture is unbound
8989
/// properly.
90-
struct BoundTexture {
90+
pub struct BoundTexture {
9191
pub target: TextureTarget
9292
}
9393

0 commit comments

Comments
 (0)