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