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

Side by Side Diff: cc/layers/solid_color_layer_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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/layers/solid_color_layer_impl.h" 5 #include "cc/layers/solid_color_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/layers/quad_sink.h" 9 #include "cc/layers/quad_sink.h"
10 #include "cc/quads/solid_color_draw_quad.h" 10 #include "cc/quads/solid_color_draw_quad.h"
(...skipping 22 matching lines...) Expand all
33 // the culler can reduce the total pixels drawn. 33 // the culler can reduce the total pixels drawn.
34 int width = content_bounds().width(); 34 int width = content_bounds().width();
35 int height = content_bounds().height(); 35 int height = content_bounds().height();
36 for (int x = 0; x < width; x += tile_size_) { 36 for (int x = 0; x < width; x += tile_size_) {
37 for (int y = 0; y < height; y += tile_size_) { 37 for (int y = 0; y < height; y += tile_size_) {
38 gfx::Rect quad_rect(x, 38 gfx::Rect quad_rect(x,
39 y, 39 y,
40 std::min(width - x, tile_size_), 40 std::min(width - x, tile_size_),
41 std::min(height - y, tile_size_)); 41 std::min(height - y, tile_size_));
42 gfx::Rect visible_quad_rect = quad_sink->UnoccludedContentRect( 42 gfx::Rect visible_quad_rect = quad_sink->UnoccludedContentRect(
43 quad_rect, draw_properties().target_space_transform); 43 this, quad_rect, draw_properties().target_space_transform);
44 if (visible_quad_rect.IsEmpty()) 44 if (visible_quad_rect.IsEmpty())
45 continue; 45 continue;
46 46
47 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create(); 47 scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
48 quad->SetNew(shared_quad_state, 48 quad->SetNew(shared_quad_state,
49 quad_rect, 49 quad_rect,
50 visible_quad_rect, 50 visible_quad_rect,
51 background_color(), 51 background_color(),
52 false); 52 false);
53 quad_sink->Append(quad.PassAs<DrawQuad>()); 53 quad_sink->Append(quad.PassAs<DrawQuad>());
54 } 54 }
55 } 55 }
56 } 56 }
57 57
58 const char* SolidColorLayerImpl::LayerTypeAsString() const { 58 const char* SolidColorLayerImpl::LayerTypeAsString() const {
59 return "cc::SolidColorLayerImpl"; 59 return "cc::SolidColorLayerImpl";
60 } 60 }
61 61
62 } // namespace cc 62 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698