Chromium Code Reviews| Index: cc/layers/picture_layer_impl.cc |
| diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
| index e281198c68aa186194a23399061b68bc1391eed6..da786b01717a8429dec6737e5d3815c81f84953a 100644 |
| --- a/cc/layers/picture_layer_impl.cc |
| +++ b/cc/layers/picture_layer_impl.cc |
| @@ -108,7 +108,10 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
| quad_sink->UseSharedQuadState(CreateSharedQuadState()); |
| AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); |
| - if (!append_quads_data->allow_tile_draw_quads) { |
| + bool use_ganesh = draw_properties().can_draw_directly_to_backbuffer && |
|
danakj
2013/05/17 23:24:01
nit: ganesh
enne (OOO)
2013/05/17 23:52:50
Done.
|
| + layer_tree_impl()->settings().force_direct_layer_drawing; |
| + |
| + if (use_ganesh || !append_quads_data->allow_tile_draw_quads) { |
| gfx::Rect geometry_rect = rect; |
| gfx::Rect opaque_rect = contents_opaque() ? geometry_rect : gfx::Rect(); |
| gfx::Size texture_size = rect.size(); |
| @@ -125,6 +128,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
| false, |
| quad_content_rect, |
| contents_scale, |
| + use_ganesh, |
| pile_); |
| if (quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data)) |
| append_quads_data->num_missing_tiles++; |
| @@ -258,6 +262,7 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
| drawing_info.contents_swizzled(), |
| iter->content_rect(), |
| iter->contents_scale(), |
| + use_ganesh, |
| pile_); |
| quad_sink->Append(quad.PassAs<DrawQuad>(), append_quads_data); |
| break; |
| @@ -364,8 +369,12 @@ void PictureLayerImpl::CalculateContentsScale( |
| float* contents_scale_x, |
| float* contents_scale_y, |
| gfx::Size* content_bounds) { |
| - if (!DrawsContent()) { |
| - DCHECK(!tilings_->num_tilings()); |
| + if (!CanHaveTilings()) { |
| + *contents_scale_x = ideal_contents_scale_; |
|
danakj
2013/05/17 23:24:01
the ideal value still needs to be set on the class
enne (OOO)
2013/05/17 23:52:50
OOPS. I will set all values here for sanity.
|
| + *contents_scale_y = ideal_contents_scale_; |
| + *content_bounds = gfx::ToCeiledSize(gfx::ScaleSize(bounds(), |
| + ideal_contents_scale_, |
| + ideal_contents_scale_)); |
| return; |
| } |
| @@ -702,9 +711,7 @@ void PictureLayerImpl::ManageTilings(bool animating_transform_to_screen) { |
| DCHECK(ideal_page_scale_); |
| DCHECK(ideal_device_scale_); |
| DCHECK(ideal_source_scale_); |
| - |
| - if (!CanHaveTilings()) |
| - return; |
| + DCHECK(CanHaveTilings()); |
| bool change_target_tiling = |
| raster_page_scale_ == 0.f || |
| @@ -948,6 +955,9 @@ bool PictureLayerImpl::CanHaveTilings() const { |
| return false; |
| if (pile_->recorded_region().IsEmpty()) |
| return false; |
| + if (draw_properties().can_draw_directly_to_backbuffer && |
| + layer_tree_impl()->settings().force_direct_layer_drawing) |
| + return false; |
| return true; |
| } |