OLD | NEW |
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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/solid_color_layer_impl.h" | 7 #include "cc/solid_color_layer_impl.h" |
8 | 8 |
9 #include "cc/quad_sink.h" | 9 #include "cc/quad_sink.h" |
10 #include "cc/solid_color_draw_quad.h" | 10 #include "cc/solid_color_draw_quad.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 { | 27 { |
28 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 28 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
29 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); | 29 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); |
30 | 30 |
31 // We create a series of smaller quads instead of just one large one so that
the | 31 // We create a series of smaller quads instead of just one large one so that
the |
32 // culler can reduce the total pixels drawn. | 32 // culler can reduce the total pixels drawn. |
33 int width = contentBounds().width(); | 33 int width = contentBounds().width(); |
34 int height = contentBounds().height(); | 34 int height = contentBounds().height(); |
35 for (int x = 0; x < width; x += m_tileSize) { | 35 for (int x = 0; x < width; x += m_tileSize) { |
36 for (int y = 0; y < height; y += m_tileSize) { | 36 for (int y = 0; y < height; y += m_tileSize) { |
37 IntRect solidTileRect(x, y, std::min(width - x, m_tileSize), std::mi
n(height - y, m_tileSize)); | 37 gfx::Rect solidTileRect(x, y, std::min(width - x, m_tileSize), std::
min(height - y, m_tileSize)); |
38 quadSink.append(SolidColorDrawQuad::create(sharedQuadState, solidTil
eRect, backgroundColor()).PassAs<DrawQuad>(), appendQuadsData); | 38 quadSink.append(SolidColorDrawQuad::create(sharedQuadState, solidTil
eRect, backgroundColor()).PassAs<DrawQuad>(), appendQuadsData); |
39 } | 39 } |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 const char* SolidColorLayerImpl::layerTypeAsString() const | 43 const char* SolidColorLayerImpl::layerTypeAsString() const |
44 { | 44 { |
45 return "SolidColorLayer"; | 45 return "SolidColorLayer"; |
46 } | 46 } |
47 | 47 |
48 } // namespace cc | 48 } // namespace cc |
OLD | NEW |