Rename image to Image. Misc

This commit is contained in:
Brian Anderson 2012-08-10 15:07:31 -07:00
parent 3708fcf9e0
commit 61e8c5c457
6 changed files with 17 additions and 21 deletions

@ -1 +1 @@
Subproject commit 0216c94378193c0912159d6436be70481ae76079
Subproject commit dcceec8f278093390659e4f74e0a4d6e1f10fc37

View file

@ -1,7 +1,7 @@
import platform::osmain;
import geometry::*;
import comm::*;
import image::base::image;
import image::base::Image;
import dl = layout::display_list;
import azure::*;
import azure::bindgen::*;
@ -128,7 +128,7 @@ fn draw_solid_color(draw_target: AzDrawTargetRef, item: dl::display_item,
AzReleaseColorPattern(red_pattern);
}
fn draw_image(draw_target: AzDrawTargetRef, item: dl::display_item, image: arc<~image>) unsafe {
fn draw_image(draw_target: AzDrawTargetRef, item: dl::display_item, image: arc<~Image>) unsafe {
let image = arc::get(&image);
let size = Size2D(image.width as i32, image.height as i32);
let stride = image.width * 4;

View file

@ -1,15 +1,11 @@
export ImageBuffer, SharedImageBuffer;
export image;
export load;
export Image;
import stb_image::image::{image, load};
import core::arc::arc;
export load;
export load_from_memory;
import stb_image::image::{image, load, load_from_memory};
// FIXME: Images must not be copied every frame. Instead we should atomically
// reference count them.
type SharedImageBuffer = arc<ImageBuffer>;
struct ImageBuffer {
data: ~[u8];
}
type Image = image;

View file

@ -9,7 +9,7 @@ import gfx::geometry::{au, zero_size_au};
import geom::point::Point2D;
import geom::rect::Rect;
import geom::size::Size2D;
import image::base::{image, load};
import image::base::{Image, load};
import util::tree;
import util::color::Color;
import text::TextBox;
@ -41,7 +41,7 @@ class Appearance {
// This will be very unhappy if it is getting run in parallel with
// anything trying to read the background image
fn get_image() -> option<~arc<~image>> {
fn get_image() -> option<~arc<~Image>> {
let mut image = none;
// Do a dance where we swap the ImageHolder out before we can
@ -82,7 +82,7 @@ class ImageHolder {
// Invariant: at least one of url and image is not none, except
// occasionally while get_image is being called
let mut url : option<~str>;
let mut image : option<arc<~image>>;
let mut image : option<arc<~Image>>;
new(-url : ~str) {
self.url = some(url);
@ -90,7 +90,7 @@ class ImageHolder {
}
// This function should not be called by two tasks at the same time
fn get_image() -> ~arc<~image> {
fn get_image() -> ~arc<~Image> {
// If this is the first time we've called this function, load
// the image and store it for the future
if self.image.is_none() {

View file

@ -1,6 +1,6 @@
import gfx::geometry::*;
import geom::rect::Rect;
import image::base::image;
import image::base::Image;
import servo_text::text_run::TextRun;
import arc::arc;
@ -8,7 +8,7 @@ import dvec::dvec;
enum item_type {
display_item_solid_color(u8, u8, u8),
display_item_image(~arc<~image>),
display_item_image(~arc<~Image>),
display_item_text(TextRun),
// FIXME: Shape code does not understand the alignment without this
padding(u8, u8, u8, u8)

View file

@ -3,7 +3,7 @@ export ImageResponseMsg, ImageReady, ImageNotReady;
export ImageCacheTask;
export image_cache_task;
import image::base::{ImageBuffer, SharedImageBuffer};
import image::base::{Image, load_from_memory};
import std::net::url::url;
import util::url::{make_url, UrlMap, url_map};
import comm::{chan, port};
@ -18,7 +18,7 @@ enum Msg {
}
enum ImageResponseMsg {
ImageReady(ImageBuffer),
ImageReady(Image),
ImageNotReady
}