| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "CCLayerTreeHost.h" | 9 #include "CCLayerTreeHost.h" |
| 10 #include "CCRenderPass.h" | 10 #include "CCRenderPass.h" |
| 11 #include "FloatQuad.h" | 11 #include "FloatQuad.h" |
| 12 #include "IntRect.h" | |
| 13 | 12 |
| 14 namespace cc { | 13 namespace cc { |
| 15 | 14 |
| 16 class CCScopedTexture; | 15 class CCScopedTexture; |
| 17 | 16 |
| 18 class CCRendererClient { | 17 class CCRendererClient { |
| 19 public: | 18 public: |
| 20 virtual const IntSize& deviceViewportSize() const = 0; | 19 virtual const IntSize& deviceViewportSize() const = 0; |
| 21 virtual const CCLayerTreeSettings& settings() const = 0; | 20 virtual const CCLayerTreeSettings& settings() const = 0; |
| 22 virtual void didLoseContext() = 0; | 21 virtual void didLoseContext() = 0; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 35 ImplPool = 1, // This pool is for textures that get allocated on the impl
thread (e.g. RenderSurfaces). | 34 ImplPool = 1, // This pool is for textures that get allocated on the impl
thread (e.g. RenderSurfaces). |
| 36 ContentPool // This pool is for textures that get allocated on the main th
read (e.g. tiles). | 35 ContentPool // This pool is for textures that get allocated on the main th
read (e.g. tiles). |
| 37 }; | 36 }; |
| 38 | 37 |
| 39 virtual ~CCRenderer() { } | 38 virtual ~CCRenderer() { } |
| 40 | 39 |
| 41 virtual const RendererCapabilities& capabilities() const = 0; | 40 virtual const RendererCapabilities& capabilities() const = 0; |
| 42 | 41 |
| 43 const CCLayerTreeSettings& settings() const { return m_client->settings(); } | 42 const CCLayerTreeSettings& settings() const { return m_client->settings(); } |
| 44 | 43 |
| 45 const IntSize& viewportSize() { return m_client->deviceViewportSize(); } | 44 gfx::Size viewportSize() { return m_client->deviceViewportSize(); } |
| 46 int viewportWidth() { return viewportSize().width(); } | 45 int viewportWidth() { return viewportSize().width(); } |
| 47 int viewportHeight() { return viewportSize().height(); } | 46 int viewportHeight() { return viewportSize().height(); } |
| 48 | 47 |
| 49 virtual void viewportChanged() { } | 48 virtual void viewportChanged() { } |
| 50 | 49 |
| 51 virtual void decideRenderPassAllocationsForFrame(const CCRenderPassList&) {
} | 50 virtual void decideRenderPassAllocationsForFrame(const CCRenderPassList&) {
} |
| 52 virtual bool haveCachedResourcesForRenderPassId(CCRenderPass::Id) const; | 51 virtual bool haveCachedResourcesForRenderPassId(CCRenderPass::Id) const; |
| 53 | 52 |
| 54 virtual void drawFrame(const CCRenderPassList&, const CCRenderPassIdHashMap&
) = 0; | 53 virtual void drawFrame(const CCRenderPassList&, const CCRenderPassIdHashMap&
) = 0; |
| 55 | 54 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 73 } | 72 } |
| 74 | 73 |
| 75 CCRendererClient* m_client; | 74 CCRendererClient* m_client; |
| 76 | 75 |
| 77 DISALLOW_COPY_AND_ASSIGN(CCRenderer); | 76 DISALLOW_COPY_AND_ASSIGN(CCRenderer); |
| 78 }; | 77 }; |
| 79 | 78 |
| 80 } | 79 } |
| 81 | 80 |
| 82 #endif // CCRenderer_h | 81 #endif // CCRenderer_h |
| OLD | NEW |