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

Side by Side Diff: cc/layers/solid_color_layer_impl.cc

Issue 341023003: cc: Pass scaled bounds to debug border quads for drawing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: avoid extra overload function 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
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/solid_color_scrollbar_layer_impl.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 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"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 SolidColorLayerImpl::SolidColorLayerImpl(LayerTreeImpl* tree_impl, int id) 14 SolidColorLayerImpl::SolidColorLayerImpl(LayerTreeImpl* tree_impl, int id)
15 : LayerImpl(tree_impl, id), 15 : LayerImpl(tree_impl, id),
16 tile_size_(256) {} 16 tile_size_(256) {}
17 17
18 SolidColorLayerImpl::~SolidColorLayerImpl() {} 18 SolidColorLayerImpl::~SolidColorLayerImpl() {}
19 19
20 scoped_ptr<LayerImpl> SolidColorLayerImpl::CreateLayerImpl( 20 scoped_ptr<LayerImpl> SolidColorLayerImpl::CreateLayerImpl(
21 LayerTreeImpl* tree_impl) { 21 LayerTreeImpl* tree_impl) {
22 return SolidColorLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); 22 return SolidColorLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>();
23 } 23 }
24 24
25 void SolidColorLayerImpl::AppendQuads(QuadSink* quad_sink, 25 void SolidColorLayerImpl::AppendQuads(QuadSink* quad_sink,
26 AppendQuadsData* append_quads_data) { 26 AppendQuadsData* append_quads_data) {
27 SharedQuadState* shared_quad_state = quad_sink->CreateSharedQuadState(); 27 SharedQuadState* shared_quad_state = quad_sink->CreateSharedQuadState();
28 PopulateSharedQuadState(shared_quad_state); 28 PopulateSharedQuadState(shared_quad_state);
29 29
30 AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); 30 AppendDebugBorderQuad(
31 quad_sink, content_bounds(), shared_quad_state, append_quads_data);
31 32
32 // We create a series of smaller quads instead of just one large one so that 33 // We create a series of smaller quads instead of just one large one so that
33 // the culler can reduce the total pixels drawn. 34 // the culler can reduce the total pixels drawn.
34 int width = content_bounds().width(); 35 int width = content_bounds().width();
35 int height = content_bounds().height(); 36 int height = content_bounds().height();
36 for (int x = 0; x < width; x += tile_size_) { 37 for (int x = 0; x < width; x += tile_size_) {
37 for (int y = 0; y < height; y += tile_size_) { 38 for (int y = 0; y < height; y += tile_size_) {
38 gfx::Rect quad_rect(x, 39 gfx::Rect quad_rect(x,
39 y, 40 y,
40 std::min(width - x, tile_size_), 41 std::min(width - x, tile_size_),
(...skipping 12 matching lines...) Expand all
53 quad_sink->Append(quad.PassAs<DrawQuad>()); 54 quad_sink->Append(quad.PassAs<DrawQuad>());
54 } 55 }
55 } 56 }
56 } 57 }
57 58
58 const char* SolidColorLayerImpl::LayerTypeAsString() const { 59 const char* SolidColorLayerImpl::LayerTypeAsString() const {
59 return "cc::SolidColorLayerImpl"; 60 return "cc::SolidColorLayerImpl";
60 } 61 }
61 62
62 } // namespace cc 63 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/solid_color_scrollbar_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698