scoped_ptr<UIResourceLayerImpl> GenerateUIResourceLayer(
FakeUIResourceLayerTreeHostImpl* host_impl,
- gfx::Size bitmap_size,
- gfx::Size layer_size,
+ const gfx::Size& bitmap_size,
+ const gfx::Size& layer_size,
bool opaque,
UIResourceId uid) {
gfx::Rect visible_content_rect(layer_size);
layer->draw_properties().render_target = layer.get();
SkBitmap skbitmap;
- skbitmap.setConfig(
- SkBitmap::kARGB_8888_Config, bitmap_size.width(), bitmap_size.height());
+ skbitmap.setConfig(SkBitmap::kARGB_8888_Config,
+ bitmap_size.width(),
+ bitmap_size.height(),
+ 0,
+ opaque ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
skbitmap.allocPixels();
skbitmap.setImmutable();
- skbitmap.setIsOpaque(opaque);
UIResourceBitmap bitmap(skbitmap);
host_impl->CreateUIResource(uid, bitmap);
}
void OpaqueBoundsTest(scoped_ptr<UIResourceLayerImpl> layer,
- gfx::Rect expected_opaque_bounds) {
+ const gfx::Rect& expected_opaque_bounds) {
MockQuadCuller quad_culler;
AppendQuadsData data;
layer->AppendQuads(&quad_culler, &data);