| Index: cc/trees/layer_tree_host_impl.cc
|
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
|
| index 84c43c20b1c3462b342036d0fbbc7311e9249e28..ac94c997aa665b666752bc20141cdd899a8b2159 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -414,6 +414,18 @@ void LayerTreeHostImpl::FrameData::AppendRenderPass(
|
| render_passes.push_back(render_pass.Pass());
|
| }
|
|
|
| +static DrawMode GetDrawMode(OutputSurface* output_surface) {
|
| + if (output_surface->software_device() && !output_surface->context3d()) {
|
| + if (output_surface->ForcedDrawToSoftwareDevice()) {
|
| + return DRAW_MODE_RESOURCELESS_SOFTWARE;
|
| + } else {
|
| + return DRAW_MODE_SOFTWARE;
|
| + }
|
| + } else {
|
| + return DRAW_MODE_HARDWARE;
|
| + }
|
| +}
|
| +
|
| static void AppendQuadsForLayer(RenderPass* target_render_pass,
|
| LayerImpl* layer,
|
| const OcclusionTrackerImpl& occlusion_tracker,
|
| @@ -592,6 +604,8 @@ bool LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) {
|
|
|
| int layers_drawn = 0;
|
|
|
| + const DrawMode draw_mode = GetDrawMode(output_surface_.get());
|
| +
|
| LayerIteratorType end =
|
| LayerIteratorType::End(frame->render_surface_layer_list);
|
| for (LayerIteratorType it =
|
| @@ -603,13 +617,11 @@ bool LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) {
|
| RenderPass* target_render_pass =
|
| frame->render_passes_by_id[target_render_pass_id];
|
|
|
| + AppendQuadsData append_quads_data(target_render_pass->id);
|
| +
|
| bool prevent_occlusion = it.target_render_surface_layer()->HasCopyRequest();
|
| occlusion_tracker.EnterLayer(it, prevent_occlusion);
|
|
|
| - AppendQuadsData append_quads_data(target_render_pass->id);
|
| - if (output_surface_->ForcedDrawToSoftwareDevice())
|
| - append_quads_data.allow_tile_draw_quads = false;
|
| -
|
| if (it.represents_target_render_surface()) {
|
| if (it->HasCopyRequest()) {
|
| have_copy_request = true;
|
| @@ -639,9 +651,9 @@ bool LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) {
|
| &has_occlusion_from_outside_target_surface)) {
|
| append_quads_data.had_occlusion_from_outside_target_surface |=
|
| has_occlusion_from_outside_target_surface;
|
| - } else {
|
| + } else if (it->WillDraw(draw_mode, resource_provider_.get())) {
|
| DCHECK_EQ(active_tree_, it->layer_tree_impl());
|
| - it->WillDraw(resource_provider_.get());
|
| +
|
| frame->will_draw_layers.push_back(*it);
|
|
|
| if (it->HasContributingDelegatedRenderPasses()) {
|
|
|