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

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

Issue 332873005: Rendering context information added to SharedQuadState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed RenderingContextId to 3dSortingContextId for clarity. 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
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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 637
638 QuadCuller quad_culler(target_render_pass, root_layer, occlusion_tracker); 638 QuadCuller quad_culler(target_render_pass, root_layer, 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 int sorting_context_id = 0;
647 SharedQuadState* shared_quad_state = quad_culler.CreateSharedQuadState(); 648 SharedQuadState* shared_quad_state = quad_culler.CreateSharedQuadState();
648 shared_quad_state->SetAll(gfx::Transform(), 649 shared_quad_state->SetAll(gfx::Transform(),
649 root_target_rect.size(), 650 root_target_rect.size(),
650 root_target_rect, 651 root_target_rect,
651 root_target_rect, 652 root_target_rect,
652 false, 653 false,
653 opacity, 654 opacity,
654 SkXfermode::kSrcOver_Mode); 655 SkXfermode::kSrcOver_Mode,
656 sorting_context_id);
655 657
656 for (Region::Iterator fill_rects(screen_background_color_region); 658 for (Region::Iterator fill_rects(screen_background_color_region);
657 fill_rects.has_rect(); 659 fill_rects.has_rect();
658 fill_rects.next()) { 660 fill_rects.next()) {
659 gfx::Rect screen_space_rect = fill_rects.rect(); 661 gfx::Rect screen_space_rect = fill_rects.rect();
660 gfx::Rect visible_screen_space_rect = screen_space_rect; 662 gfx::Rect visible_screen_space_rect = screen_space_rect;
661 // Skip the quad culler and just append the quads directly to avoid 663 // Skip the quad culler and just append the quads directly to avoid
662 // occlusion checks. 664 // occlusion checks.
663 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); 665 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
664 quad->SetNew(shared_quad_state, 666 quad->SetNew(shared_quad_state,
(...skipping 2483 matching lines...) Expand 10 before | Expand all | Expand 10 after
3148 } 3150 }
3149 3151
3150 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3152 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3151 std::vector<PictureLayerImpl*>::iterator it = 3153 std::vector<PictureLayerImpl*>::iterator it =
3152 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3154 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3153 DCHECK(it != picture_layers_.end()); 3155 DCHECK(it != picture_layers_.end());
3154 picture_layers_.erase(it); 3156 picture_layers_.erase(it);
3155 } 3157 }
3156 3158
3157 } // namespace cc 3159 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698