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

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

Issue 304203005: Remove const LayerImpl* from QuadSink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onlyQuadSink
Patch Set: Created 6 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
« cc/layers/quad_sink.cc ('K') | « cc/test/mock_quad_culler.cc ('k') | no next file » | 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 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 << output_surface->capabilities().deferred_gl_initialization; 575 << output_surface->capabilities().deferred_gl_initialization;
576 return DRAW_MODE_SOFTWARE; 576 return DRAW_MODE_SOFTWARE;
577 } 577 }
578 } 578 }
579 579
580 static void AppendQuadsForLayer( 580 static void AppendQuadsForLayer(
581 RenderPass* target_render_pass, 581 RenderPass* target_render_pass,
582 LayerImpl* layer, 582 LayerImpl* layer,
583 const OcclusionTracker<LayerImpl>& occlusion_tracker, 583 const OcclusionTracker<LayerImpl>& occlusion_tracker,
584 AppendQuadsData* append_quads_data) { 584 AppendQuadsData* append_quads_data) {
585 QuadSink quad_culler(target_render_pass, layer, &occlusion_tracker); 585 QuadSink quad_culler(target_render_pass, &occlusion_tracker);
586 layer->AppendQuads(&quad_culler, append_quads_data); 586 layer->AppendQuads(&quad_culler, append_quads_data);
587 } 587 }
588 588
589 static void AppendQuadsForRenderSurfaceLayer( 589 static void AppendQuadsForRenderSurfaceLayer(
590 RenderPass* target_render_pass, 590 RenderPass* target_render_pass,
591 LayerImpl* layer, 591 LayerImpl* layer,
592 const RenderPass* contributing_render_pass, 592 const RenderPass* contributing_render_pass,
593 const OcclusionTracker<LayerImpl>& occlusion_tracker, 593 const OcclusionTracker<LayerImpl>& occlusion_tracker,
594 AppendQuadsData* append_quads_data) { 594 AppendQuadsData* append_quads_data) {
595 QuadSink quad_culler(target_render_pass, layer, &occlusion_tracker); 595 QuadSink quad_culler(target_render_pass, &occlusion_tracker);
596 596
597 bool is_replica = false; 597 bool is_replica = false;
598 layer->render_surface()->AppendQuads(&quad_culler, 598 layer->render_surface()->AppendQuads(&quad_culler,
599 append_quads_data, 599 append_quads_data,
600 is_replica, 600 is_replica,
601 contributing_render_pass->id); 601 contributing_render_pass->id);
602 602
603 // Add replica after the surface so that it appears below the surface. 603 // Add replica after the surface so that it appears below the surface.
604 if (layer->has_replica()) { 604 if (layer->has_replica()) {
605 is_replica = true; 605 is_replica = true;
(...skipping 22 matching lines...) Expand all
628 // Divide the fill region into the part to be filled with the overhang 628 // Divide the fill region into the part to be filled with the overhang
629 // resource and the part to be filled with the background color. 629 // resource and the part to be filled with the background color.
630 Region screen_background_color_region = fill_region; 630 Region screen_background_color_region = fill_region;
631 Region overhang_region; 631 Region overhang_region;
632 if (overhang_resource_id) { 632 if (overhang_resource_id) {
633 overhang_region = fill_region; 633 overhang_region = fill_region;
634 overhang_region.Subtract(root_scroll_layer_rect); 634 overhang_region.Subtract(root_scroll_layer_rect);
635 screen_background_color_region.Intersect(root_scroll_layer_rect); 635 screen_background_color_region.Intersect(root_scroll_layer_rect);
636 } 636 }
637 637
638 QuadSink quad_culler(target_render_pass, root_layer, &occlusion_tracker); 638 QuadSink quad_culler(target_render_pass, &occlusion_tracker);
639 639
640 // Manually create the quad state for the gutter quads, as the root layer 640 // Manually create the quad state for the gutter quads, as the root layer
641 // doesn't have any bounds and so can't generate this itself. 641 // doesn't have any bounds and so can't generate this itself.
642 // TODO(danakj): Make the gutter quads generated by the solid color layer 642 // TODO(danakj): Make the gutter quads generated by the solid color layer
643 // (make it smarter about generating quads to fill unoccluded areas). 643 // (make it smarter about generating quads to fill unoccluded areas).
644 644
645 gfx::Rect root_target_rect = root_layer->render_surface()->content_rect(); 645 gfx::Rect root_target_rect = root_layer->render_surface()->content_rect();
646 float opacity = 1.f; 646 float opacity = 1.f;
647 SharedQuadState* shared_quad_state = quad_culler.CreateSharedQuadState(); 647 SharedQuadState* shared_quad_state = quad_culler.CreateSharedQuadState();
648 shared_quad_state->SetAll(gfx::Transform(), 648 shared_quad_state->SetAll(gfx::Transform(),
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after
3128 swap_promise_monitor_.erase(monitor); 3128 swap_promise_monitor_.erase(monitor);
3129 } 3129 }
3130 3130
3131 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3131 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3132 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3132 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3133 for (; it != swap_promise_monitor_.end(); it++) 3133 for (; it != swap_promise_monitor_.end(); it++)
3134 (*it)->OnSetNeedsRedrawOnImpl(); 3134 (*it)->OnSetNeedsRedrawOnImpl();
3135 } 3135 }
3136 3136
3137 } // namespace cc 3137 } // namespace cc
OLDNEW
« cc/layers/quad_sink.cc ('K') | « cc/test/mock_quad_culler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698