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 "FloatQuad.h" | 8 #include "FloatQuad.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
11 #include "cc/managed_memory_policy.h" | 11 #include "cc/managed_memory_policy.h" |
12 #include "cc/render_pass.h" | 12 #include "cc/render_pass.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 class ScopedTexture; | 16 class ScopedTexture; |
17 | 17 |
18 class RendererClient { | 18 class RendererClient { |
19 public: | 19 public: |
20 virtual const IntSize& deviceViewportSize() const = 0; | 20 virtual const gfx::Size& deviceViewportSize() const = 0; |
21 virtual const LayerTreeSettings& settings() const = 0; | 21 virtual const LayerTreeSettings& settings() const = 0; |
22 virtual void didLoseContext() = 0; | 22 virtual void didLoseContext() = 0; |
23 virtual void onSwapBuffersComplete() = 0; | 23 virtual void onSwapBuffersComplete() = 0; |
24 virtual void setFullRootLayerDamage() = 0; | 24 virtual void setFullRootLayerDamage() = 0; |
25 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; | 25 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; |
26 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) =
0; | 26 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) =
0; |
27 protected: | 27 protected: |
28 virtual ~RendererClient() { } | 28 virtual ~RendererClient() { } |
29 }; | 29 }; |
30 | 30 |
(...skipping 23 matching lines...) Expand all Loading... |
54 | 54 |
55 virtual void drawFrame(const RenderPassList&, const RenderPassIdHashMap&) =
0; | 55 virtual void drawFrame(const RenderPassList&, const RenderPassIdHashMap&) =
0; |
56 | 56 |
57 // waits for rendering to finish | 57 // waits for rendering to finish |
58 virtual void finish() = 0; | 58 virtual void finish() = 0; |
59 | 59 |
60 virtual void doNoOp() { } | 60 virtual void doNoOp() { } |
61 // puts backbuffer onscreen | 61 // puts backbuffer onscreen |
62 virtual bool swapBuffers() = 0; | 62 virtual bool swapBuffers() = 0; |
63 | 63 |
64 virtual void getFramebufferPixels(void *pixels, const IntRect&) = 0; | 64 virtual void getFramebufferPixels(void *pixels, const gfx::Rect&) = 0; |
65 | 65 |
66 virtual bool isContextLost(); | 66 virtual bool isContextLost(); |
67 | 67 |
68 virtual void setVisible(bool) = 0; | 68 virtual void setVisible(bool) = 0; |
69 | 69 |
70 protected: | 70 protected: |
71 explicit Renderer(RendererClient* client) | 71 explicit Renderer(RendererClient* client) |
72 : m_client(client) | 72 : m_client(client) |
73 { | 73 { |
74 } | 74 } |
75 | 75 |
76 RendererClient* m_client; | 76 RendererClient* m_client; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(Renderer); | 78 DISALLOW_COPY_AND_ASSIGN(Renderer); |
79 }; | 79 }; |
80 | 80 |
81 } | 81 } |
82 | 82 |
83 #endif // CCRenderer_h | 83 #endif // CCRenderer_h |
OLD | NEW |