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 CC_RENDERER_H_ | 5 #ifndef CC_RENDERER_H_ |
6 #define CC_RENDERER_H_ | 6 #define CC_RENDERER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 gfx::Size viewportSize() { return m_client->deviceViewportSize(); } | 47 gfx::Size viewportSize() { return m_client->deviceViewportSize(); } |
48 int viewportWidth() { return viewportSize().width(); } | 48 int viewportWidth() { return viewportSize().width(); } |
49 int viewportHeight() { return viewportSize().height(); } | 49 int viewportHeight() { return viewportSize().height(); } |
50 | 50 |
51 virtual void viewportChanged() { } | 51 virtual void viewportChanged() { } |
52 | 52 |
53 virtual void decideRenderPassAllocationsForFrame(const RenderPassList&) { } | 53 virtual void decideRenderPassAllocationsForFrame(const RenderPassList&) { } |
54 virtual bool haveCachedResourcesForRenderPassId(RenderPass::Id) const; | 54 virtual bool haveCachedResourcesForRenderPassId(RenderPass::Id) const; |
55 | 55 |
56 virtual void drawFrame(const RenderPassList&, const RenderPassIdHashMap&) =
0; | 56 // This passes ownership of the render passes to the renderer. It should |
| 57 // consume them, and empty the list and hash map. |
| 58 virtual void drawFrame(RenderPassList&, RenderPassIdHashMap&) = 0; |
57 | 59 |
58 // waits for rendering to finish | 60 // waits for rendering to finish |
59 virtual void finish() = 0; | 61 virtual void finish() = 0; |
60 | 62 |
61 virtual void doNoOp() { } | 63 virtual void doNoOp() { } |
62 // puts backbuffer onscreen | 64 // puts backbuffer onscreen |
63 virtual bool swapBuffers() = 0; | 65 virtual bool swapBuffers() = 0; |
64 | 66 |
65 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) = 0; | 67 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) = 0; |
66 | 68 |
(...skipping 10 matching lines...) Expand all Loading... |
77 } | 79 } |
78 | 80 |
79 RendererClient* m_client; | 81 RendererClient* m_client; |
80 | 82 |
81 DISALLOW_COPY_AND_ASSIGN(Renderer); | 83 DISALLOW_COPY_AND_ASSIGN(Renderer); |
82 }; | 84 }; |
83 | 85 |
84 } | 86 } |
85 | 87 |
86 #endif // CC_RENDERER_H_ | 88 #endif // CC_RENDERER_H_ |
OLD | NEW |