| 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" |
| 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 CompositorFrameAck; |
| 16 class ScopedResource; | 17 class ScopedResource; |
| 17 | 18 |
| 18 class CC_EXPORT RendererClient { | 19 class CC_EXPORT RendererClient { |
| 19 public: | 20 public: |
| 20 virtual const gfx::Size& deviceViewportSize() const = 0; | 21 virtual const gfx::Size& deviceViewportSize() const = 0; |
| 21 virtual const LayerTreeSettings& settings() const = 0; | 22 virtual const LayerTreeSettings& settings() const = 0; |
| 22 virtual void didLoseContext() = 0; | 23 virtual void didLoseContext() = 0; |
| 23 virtual void onSwapBuffersComplete() = 0; | 24 virtual void onSwapBuffersComplete() = 0; |
| 24 virtual void setFullRootLayerDamage() = 0; | 25 virtual void setFullRootLayerDamage() = 0; |
| 25 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; | 26 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 42 | 43 |
| 43 virtual const RendererCapabilities& capabilities() const = 0; | 44 virtual const RendererCapabilities& capabilities() const = 0; |
| 44 | 45 |
| 45 const LayerTreeSettings& settings() const { return m_client->settings(); } | 46 const LayerTreeSettings& settings() const { return m_client->settings(); } |
| 46 | 47 |
| 47 gfx::Size viewportSize() { return m_client->deviceViewportSize(); } | 48 gfx::Size viewportSize() { return m_client->deviceViewportSize(); } |
| 48 int viewportWidth() { return viewportSize().width(); } | 49 int viewportWidth() { return viewportSize().width(); } |
| 49 int viewportHeight() { return viewportSize().height(); } | 50 int viewportHeight() { return viewportSize().height(); } |
| 50 | 51 |
| 51 virtual void viewportChanged() { } | 52 virtual void viewportChanged() { } |
| 53 virtual void receiveCompositorFrameAck(const CompositorFrameAck&) { } |
| 52 | 54 |
| 53 virtual void decideRenderPassAllocationsForFrame(const RenderPassList&) { } | 55 virtual void decideRenderPassAllocationsForFrame(const RenderPassList&) { } |
| 54 virtual bool haveCachedResourcesForRenderPassId(RenderPass::Id) const; | 56 virtual bool haveCachedResourcesForRenderPassId(RenderPass::Id) const; |
| 55 | 57 |
| 56 // This passes ownership of the render passes to the renderer. It should | 58 // This passes ownership of the render passes to the renderer. It should |
| 57 // consume them, and empty the list and hash map. | 59 // consume them, and empty the list and hash map. |
| 58 virtual void drawFrame(RenderPassList&, RenderPassIdHashMap&) = 0; | 60 virtual void drawFrame(RenderPassList&, RenderPassIdHashMap&) = 0; |
| 59 | 61 |
| 60 // waits for rendering to finish | 62 // waits for rendering to finish |
| 61 virtual void finish() = 0; | 63 virtual void finish() = 0; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 79 } | 81 } |
| 80 | 82 |
| 81 RendererClient* m_client; | 83 RendererClient* m_client; |
| 82 | 84 |
| 83 DISALLOW_COPY_AND_ASSIGN(Renderer); | 85 DISALLOW_COPY_AND_ASSIGN(Renderer); |
| 84 }; | 86 }; |
| 85 | 87 |
| 86 } | 88 } |
| 87 | 89 |
| 88 #endif // CC_RENDERER_H_ | 90 #endif // CC_RENDERER_H_ |
| OLD | NEW |