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 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
8 | 8 |
9 #include "CCSolidColorLayerImpl.h" | 9 #include "CCSolidColorLayerImpl.h" |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 CCSolidColorLayerImpl::CCSolidColorLayerImpl(int id) | 21 CCSolidColorLayerImpl::CCSolidColorLayerImpl(int id) |
22 : CCLayerImpl(id) | 22 : CCLayerImpl(id) |
23 , m_tileSize(256) | 23 , m_tileSize(256) |
24 { | 24 { |
25 } | 25 } |
26 | 26 |
27 CCSolidColorLayerImpl::~CCSolidColorLayerImpl() | 27 CCSolidColorLayerImpl::~CCSolidColorLayerImpl() |
28 { | 28 { |
29 } | 29 } |
30 | 30 |
31 void CCSolidColorLayerImpl::appendQuads(CCQuadSink& quadSink, bool&) | 31 void CCSolidColorLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsData&
appendQuadsData) |
32 { | 32 { |
33 CCSharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createShare
dQuadState()); | 33 CCSharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createShare
dQuadState()); |
34 appendDebugBorderQuad(quadSink, sharedQuadState); | 34 appendDebugBorderQuad(quadSink, sharedQuadState, appendQuadsData); |
35 | 35 |
36 // We create a series of smaller quads instead of just one large one so that
the | 36 // We create a series of smaller quads instead of just one large one so that
the |
37 // culler can reduce the total pixels drawn. | 37 // culler can reduce the total pixels drawn. |
38 int width = contentBounds().width(); | 38 int width = contentBounds().width(); |
39 int height = contentBounds().height(); | 39 int height = contentBounds().height(); |
40 for (int x = 0; x < width; x += m_tileSize) { | 40 for (int x = 0; x < width; x += m_tileSize) { |
41 for (int y = 0; y < height; y += m_tileSize) { | 41 for (int y = 0; y < height; y += m_tileSize) { |
42 IntRect solidTileRect(x, y, min(width - x, m_tileSize), min(height -
y, m_tileSize)); | 42 IntRect solidTileRect(x, y, min(width - x, m_tileSize), min(height -
y, m_tileSize)); |
43 quadSink.append(CCSolidColorDrawQuad::create(sharedQuadState, solidT
ileRect, backgroundColor())); | 43 quadSink.append(CCSolidColorDrawQuad::create(sharedQuadState, solidT
ileRect, backgroundColor()), appendQuadsData); |
44 } | 44 } |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 } // namespace WebCore | 48 } // namespace WebCore |
49 #endif // USE(ACCELERATED_COMPOSITING) | 49 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |