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 CCRenderer_h | 5 #ifndef CCRenderer_h |
6 #define CCRenderer_h | 6 #define CCRenderer_h |
7 | 7 |
8 #include "CCLayerTreeHost.h" | 8 #include "CCLayerTreeHost.h" |
9 #include "CCRenderPass.h" | 9 #include "CCRenderPass.h" |
10 #include "FloatQuad.h" | 10 #include "FloatQuad.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 const CCLayerTreeSettings& settings() const { return m_client->settings(); } | 46 const CCLayerTreeSettings& settings() const { return m_client->settings(); } |
47 | 47 |
48 const IntSize& viewportSize() { return m_client->deviceViewportSize(); } | 48 const IntSize& viewportSize() { return m_client->deviceViewportSize(); } |
49 int viewportWidth() { return viewportSize().width(); } | 49 int viewportWidth() { return viewportSize().width(); } |
50 int viewportHeight() { return viewportSize().height(); } | 50 int viewportHeight() { return viewportSize().height(); } |
51 | 51 |
52 virtual void viewportChanged() { } | 52 virtual void viewportChanged() { } |
53 | 53 |
54 virtual void decideRenderPassAllocationsForFrame(const CCRenderPassList&) {
} | 54 virtual void decideRenderPassAllocationsForFrame(const CCRenderPassList&) {
} |
55 virtual bool haveCachedResourcesForRenderPassId(CCRenderPass::Id) const { re
turn false; } | 55 virtual bool haveCachedResourcesForRenderPassId(CCRenderPass::Id) const; |
56 | 56 |
57 virtual void drawFrame(const CCRenderPassList&, const CCRenderPassIdHashMap&
) = 0; | 57 virtual void drawFrame(const CCRenderPassList&, const CCRenderPassIdHashMap&
) = 0; |
58 | 58 |
59 // waits for rendering to finish | 59 // waits for rendering to finish |
60 virtual void finish() = 0; | 60 virtual void finish() = 0; |
61 | 61 |
62 virtual void doNoOp() { } | 62 virtual void doNoOp() { } |
63 // puts backbuffer onscreen | 63 // puts backbuffer onscreen |
64 virtual bool swapBuffers() = 0; | 64 virtual bool swapBuffers() = 0; |
65 | 65 |
66 virtual void getFramebufferPixels(void *pixels, const IntRect&) = 0; | 66 virtual void getFramebufferPixels(void *pixels, const IntRect&) = 0; |
67 | 67 |
68 virtual bool isContextLost() { return false; } | 68 virtual bool isContextLost(); |
69 | 69 |
70 virtual void setVisible(bool) = 0; | 70 virtual void setVisible(bool) = 0; |
71 | 71 |
72 protected: | 72 protected: |
73 explicit CCRenderer(CCRendererClient* client) | 73 explicit CCRenderer(CCRendererClient* client) |
74 : m_client(client) | 74 : m_client(client) |
75 { | 75 { |
76 } | 76 } |
77 | 77 |
78 CCRendererClient* m_client; | 78 CCRendererClient* m_client; |
79 }; | 79 }; |
80 | 80 |
81 } | 81 } |
82 | 82 |
83 #endif // CCRenderer_h | 83 #endif // CCRenderer_h |
OLD | NEW |