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 14 matching lines...) Expand all Loading... |
25 virtual void setFullRootLayerDamage() = 0; | 25 virtual void setFullRootLayerDamage() = 0; |
26 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; | 26 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; |
27 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) =
0; | 27 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) =
0; |
28 virtual bool hasImplThread() const = 0; | 28 virtual bool hasImplThread() const = 0; |
29 protected: | 29 protected: |
30 virtual ~RendererClient() { } | 30 virtual ~RendererClient() { } |
31 }; | 31 }; |
32 | 32 |
33 class CC_EXPORT Renderer { | 33 class CC_EXPORT Renderer { |
34 public: | 34 public: |
35 // This enum defines the various resource pools for the ResourceProvider | |
36 // where textures get allocated. | |
37 enum ResourcePool { | |
38 ImplPool = 1, // This pool is for textures that get allocated on the impl
thread (e.g. RenderSurfaces). | |
39 ContentPool // This pool is for textures that get allocated on the main th
read (e.g. tiles). | |
40 }; | |
41 | |
42 virtual ~Renderer() { } | 35 virtual ~Renderer() { } |
43 | 36 |
44 virtual const RendererCapabilities& capabilities() const = 0; | 37 virtual const RendererCapabilities& capabilities() const = 0; |
45 | 38 |
46 const LayerTreeSettings& settings() const { return m_client->settings(); } | 39 const LayerTreeSettings& settings() const { return m_client->settings(); } |
47 | 40 |
48 gfx::Size viewportSize() { return m_client->deviceViewportSize(); } | 41 gfx::Size viewportSize() { return m_client->deviceViewportSize(); } |
49 int viewportWidth() { return viewportSize().width(); } | 42 int viewportWidth() { return viewportSize().width(); } |
50 int viewportHeight() { return viewportSize().height(); } | 43 int viewportHeight() { return viewportSize().height(); } |
51 | 44 |
(...skipping 29 matching lines...) Expand all Loading... |
81 } | 74 } |
82 | 75 |
83 RendererClient* m_client; | 76 RendererClient* m_client; |
84 | 77 |
85 DISALLOW_COPY_AND_ASSIGN(Renderer); | 78 DISALLOW_COPY_AND_ASSIGN(Renderer); |
86 }; | 79 }; |
87 | 80 |
88 } | 81 } |
89 | 82 |
90 #endif // CC_RENDERER_H_ | 83 #endif // CC_RENDERER_H_ |
OLD | NEW |