Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 16211002: Skip drawing unsupported layers in forced software mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Add test. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layers/solid_color_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 LayerIteratorType::End(frame->render_surface_layer_list); 596 LayerIteratorType::End(frame->render_surface_layer_list);
597 for (LayerIteratorType it = 597 for (LayerIteratorType it =
598 LayerIteratorType::Begin(frame->render_surface_layer_list); 598 LayerIteratorType::Begin(frame->render_surface_layer_list);
599 it != end; 599 it != end;
600 ++it) { 600 ++it) {
601 RenderPass::Id target_render_pass_id = 601 RenderPass::Id target_render_pass_id =
602 it.target_render_surface_layer()->render_surface()->RenderPassId(); 602 it.target_render_surface_layer()->render_surface()->RenderPassId();
603 RenderPass* target_render_pass = 603 RenderPass* target_render_pass =
604 frame->render_passes_by_id[target_render_pass_id]; 604 frame->render_passes_by_id[target_render_pass_id];
605 605
606 if (output_surface_->ForcedDrawToSoftwareDevice() &&
607 !it->CanDrawInTilelessSoftwareMode()) {
608 continue;
609 }
610
606 bool prevent_occlusion = it.target_render_surface_layer()->HasCopyRequest(); 611 bool prevent_occlusion = it.target_render_surface_layer()->HasCopyRequest();
607 occlusion_tracker.EnterLayer(it, prevent_occlusion); 612 occlusion_tracker.EnterLayer(it, prevent_occlusion);
608 613
609 AppendQuadsData append_quads_data(target_render_pass->id); 614 AppendQuadsData append_quads_data(target_render_pass->id);
610 if (output_surface_->ForcedDrawToSoftwareDevice()) 615 if (output_surface_->ForcedDrawToSoftwareDevice())
611 append_quads_data.allow_tile_draw_quads = false; 616 append_quads_data.allow_tile_draw_quads = false;
aelias_OOO_until_Jul13 2013/05/30 00:46:51 Nit: I suggest moving up the AppendQuadsData to th
612 617
613 if (it.represents_target_render_surface()) { 618 if (it.represents_target_render_surface()) {
614 if (it->HasCopyRequest()) { 619 if (it->HasCopyRequest()) {
615 have_copy_request = true; 620 have_copy_request = true;
616 it->TakeCopyRequests(&target_render_pass->copy_requests); 621 it->TakeCopyRequests(&target_render_pass->copy_requests);
617 } 622 }
618 } else if (it.represents_contributing_render_surface()) { 623 } else if (it.represents_contributing_render_surface()) {
619 RenderPass::Id contributing_render_pass_id = 624 RenderPass::Id contributing_render_pass_id =
620 it->render_surface()->RenderPassId(); 625 it->render_surface()->RenderPassId();
621 RenderPass* contributing_render_pass = 626 RenderPass* contributing_render_pass =
(...skipping 12 matching lines...) Expand all
634 it->visible_content_rect(), 639 it->visible_content_rect(),
635 it->draw_transform(), 640 it->draw_transform(),
636 impl_draw_transform_is_unknown, 641 impl_draw_transform_is_unknown,
637 it->is_clipped(), 642 it->is_clipped(),
638 it->clip_rect(), 643 it->clip_rect(),
639 &has_occlusion_from_outside_target_surface)) { 644 &has_occlusion_from_outside_target_surface)) {
640 append_quads_data.had_occlusion_from_outside_target_surface |= 645 append_quads_data.had_occlusion_from_outside_target_surface |=
641 has_occlusion_from_outside_target_surface; 646 has_occlusion_from_outside_target_surface;
642 } else { 647 } else {
643 DCHECK_EQ(active_tree_, it->layer_tree_impl()); 648 DCHECK_EQ(active_tree_, it->layer_tree_impl());
649
aelias_OOO_until_Jul13 2013/05/30 00:46:51 Nit: newline
644 it->WillDraw(resource_provider_.get()); 650 it->WillDraw(resource_provider_.get());
645 frame->will_draw_layers.push_back(*it); 651 frame->will_draw_layers.push_back(*it);
646 652
647 if (it->HasContributingDelegatedRenderPasses()) { 653 if (it->HasContributingDelegatedRenderPasses()) {
648 RenderPass::Id contributing_render_pass_id = 654 RenderPass::Id contributing_render_pass_id =
649 it->FirstContributingRenderPassId(); 655 it->FirstContributingRenderPassId();
650 while (frame->render_passes_by_id.find(contributing_render_pass_id) != 656 while (frame->render_passes_by_id.find(contributing_render_pass_id) !=
651 frame->render_passes_by_id.end()) { 657 frame->render_passes_by_id.end()) {
652 RenderPass* render_pass = 658 RenderPass* render_pass =
653 frame->render_passes_by_id[contributing_render_pass_id]; 659 frame->render_passes_by_id[contributing_render_pass_id];
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
2242 } 2248 }
2243 2249
2244 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) { 2250 void LayerTreeHostImpl::SetDebugState(const LayerTreeDebugState& debug_state) {
2245 if (debug_state_.continuous_painting != debug_state.continuous_painting) 2251 if (debug_state_.continuous_painting != debug_state.continuous_painting)
2246 paint_time_counter_->ClearHistory(); 2252 paint_time_counter_->ClearHistory();
2247 2253
2248 debug_state_ = debug_state; 2254 debug_state_ = debug_state;
2249 } 2255 }
2250 2256
2251 } // namespace cc 2257 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/solid_color_layer_impl.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698