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 #ifndef MockCCQuadCuller_h | 5 #ifndef MockCCQuadCuller_h |
6 #define MockCCQuadCuller_h | 6 #define MockCCQuadCuller_h |
7 | 7 |
8 #include "CCDrawQuad.h" | 8 #include "CCDrawQuad.h" |
9 #include "CCQuadSink.h" | 9 #include "CCQuadSink.h" |
10 #include "IntRect.h" | 10 #include "IntRect.h" |
11 #include <wtf/PassOwnPtr.h> | 11 #include <wtf/PassOwnPtr.h> |
12 | 12 |
13 namespace WebCore { | 13 namespace WebCore { |
14 | 14 |
15 class MockCCQuadCuller : public CCQuadSink { | 15 class MockCCQuadCuller : public CCQuadSink { |
16 public: | 16 public: |
17 MockCCQuadCuller() | 17 MockCCQuadCuller() |
18 : m_activeQuadList(m_quadListStorage) | 18 : m_activeQuadList(m_quadListStorage) |
19 , m_activeSharedQuadStateList(m_sharedQuadStateStorage) | 19 , m_activeSharedQuadStateList(m_sharedQuadStateStorage) |
20 { } | 20 { } |
21 | 21 |
22 explicit MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateLis
t& externalSharedQuadStateList) | 22 explicit MockCCQuadCuller(CCQuadList& externalQuadList, CCSharedQuadStateLis
t& externalSharedQuadStateList) |
23 : m_activeQuadList(externalQuadList) | 23 : m_activeQuadList(externalQuadList) |
24 , m_activeSharedQuadStateList(externalSharedQuadStateList) | 24 , m_activeSharedQuadStateList(externalSharedQuadStateList) |
25 { } | 25 { } |
26 | 26 |
27 virtual bool append(WTF::PassOwnPtr<CCDrawQuad> newQuad) OVERRIDE | 27 virtual bool append(PassOwnPtr<CCDrawQuad> newQuad, CCAppendQuadsData&) OVER
RIDE |
28 { | 28 { |
29 OwnPtr<CCDrawQuad> drawQuad = newQuad; | 29 OwnPtr<CCDrawQuad> drawQuad = newQuad; |
30 if (!drawQuad->quadRect().isEmpty()) { | 30 if (!drawQuad->quadRect().isEmpty()) { |
31 m_activeQuadList.append(drawQuad.release()); | 31 m_activeQuadList.append(drawQuad.release()); |
32 return true; | 32 return true; |
33 } | 33 } |
34 return false; | 34 return false; |
35 } | 35 } |
36 | 36 |
37 virtual CCSharedQuadState* useSharedQuadState(PassOwnPtr<CCSharedQuadState>
passSharedQuadState) OVERRIDE | 37 virtual CCSharedQuadState* useSharedQuadState(PassOwnPtr<CCSharedQuadState>
passSharedQuadState) OVERRIDE |
(...skipping 11 matching lines...) Expand all Loading... |
49 | 49 |
50 private: | 50 private: |
51 CCQuadList& m_activeQuadList; | 51 CCQuadList& m_activeQuadList; |
52 CCQuadList m_quadListStorage; | 52 CCQuadList m_quadListStorage; |
53 CCSharedQuadStateList& m_activeSharedQuadStateList; | 53 CCSharedQuadStateList& m_activeSharedQuadStateList; |
54 CCSharedQuadStateList m_sharedQuadStateStorage; | 54 CCSharedQuadStateList m_sharedQuadStateStorage; |
55 }; | 55 }; |
56 | 56 |
57 } // namespace WebCore | 57 } // namespace WebCore |
58 #endif // MockCCQuadCuller_h | 58 #endif // MockCCQuadCuller_h |
OLD | NEW |