mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Fix task failure when loading wikipedia.
There is still an issue with alpha display, so there is likely a problem elsewhere, but this at least allows the page to load for now (ref #2554).
This commit is contained in:
parent
a5965442b5
commit
78ef16bfae
1 changed files with 7 additions and 5 deletions
|
@ -5,7 +5,7 @@
|
||||||
use font_context::FontContext;
|
use font_context::FontContext;
|
||||||
use style::computed_values::border_style;
|
use style::computed_values::border_style;
|
||||||
|
|
||||||
use azure::azure_hl::{B8G8R8A8, Color, ColorPattern, DrawOptions, DrawSurfaceOptions, DrawTarget};
|
use azure::azure_hl::{B8G8R8A8, A8, Color, ColorPattern, DrawOptions, DrawSurfaceOptions, DrawTarget};
|
||||||
use azure::azure_hl::{Linear, SourceOp, StrokeOptions};
|
use azure::azure_hl::{Linear, SourceOp, StrokeOptions};
|
||||||
use azure::AZ_CAP_BUTT;
|
use azure::AZ_CAP_BUTT;
|
||||||
use azure::AzFloat;
|
use azure::AzFloat;
|
||||||
|
@ -100,9 +100,11 @@ impl<'a> RenderContext<'a> {
|
||||||
|
|
||||||
pub fn draw_image(&self, bounds: Rect<Au>, image: Arc<Box<Image>>) {
|
pub fn draw_image(&self, bounds: Rect<Au>, image: Arc<Box<Image>>) {
|
||||||
let size = Size2D(image.width as i32, image.height as i32);
|
let size = Size2D(image.width as i32, image.height as i32);
|
||||||
let (pixel_width, pixels) = match image.pixels {
|
let (pixel_width, pixels, source_format) = match image.pixels {
|
||||||
RGBA8(ref pixels) => (4, pixels.as_slice()),
|
RGBA8(ref pixels) => (4, pixels.as_slice(), B8G8R8A8),
|
||||||
RGB8(_) | K8(_) | KA8(_) => fail!("color type not supported"),
|
K8(ref pixels) => (1, pixels.as_slice(), A8),
|
||||||
|
RGB8(_) => fail!("RGB8 color type not supported"),
|
||||||
|
KA8(_) => fail!("KA8 color type not supported"),
|
||||||
};
|
};
|
||||||
let stride = image.width * pixel_width;
|
let stride = image.width * pixel_width;
|
||||||
|
|
||||||
|
@ -111,7 +113,7 @@ impl<'a> RenderContext<'a> {
|
||||||
let azure_surface = draw_target_ref.create_source_surface_from_data(pixels,
|
let azure_surface = draw_target_ref.create_source_surface_from_data(pixels,
|
||||||
size,
|
size,
|
||||||
stride as i32,
|
stride as i32,
|
||||||
B8G8R8A8);
|
source_format);
|
||||||
let source_rect = Rect(Point2D(0u as AzFloat, 0u as AzFloat),
|
let source_rect = Rect(Point2D(0u as AzFloat, 0u as AzFloat),
|
||||||
Size2D(image.width as AzFloat, image.height as AzFloat));
|
Size2D(image.width as AzFloat, image.height as AzFloat));
|
||||||
let dest_rect = bounds.to_azure_rect();
|
let dest_rect = bounds.to_azure_rect();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue