Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 CCLayerTreeHost_h | 5 #ifndef CCLayerTreeHost_h |
| 6 #define CCLayerTreeHost_h | 6 #define CCLayerTreeHost_h |
| 7 | 7 |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "CCAnimationEvents.h" | 10 #include "CCAnimationEvents.h" |
| 11 #include "CCGraphicsContext.h" | 11 #include "CCGraphicsContext.h" |
| 12 #include "CCLayerTreeHostClient.h" | 12 #include "CCLayerTreeHostClient.h" |
| 13 #include "CCLayerTreeHostCommon.h" | 13 #include "CCLayerTreeHostCommon.h" |
| 14 #include "IntRect.h" | 14 #include "IntRect.h" |
| 15 #include "base/basictypes.h" | 15 #include "base/basictypes.h" |
| 16 #include "base/hash_tables.h" | 16 #include "base/hash_tables.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/scoped_ptr.h" | 18 #include "base/memory/scoped_ptr.h" |
| 19 #include "cc/occlusion_tracker.h" | 19 #include "cc/occlusion_tracker.h" |
| 20 #include "cc/prioritized_texture_manager.h" | 20 #include "cc/prioritized_texture_manager.h" |
| 21 #include "cc/proxy.h" | 21 #include "cc/proxy.h" |
| 22 #include "cc/rate_limiter.h" | 22 #include "cc/rate_limiter.h" |
| 23 #include "cc/rendering_stats.h" | 23 #include "cc/rendering_stats.h" |
| 24 #include "cc/scoped_ptr_vector.h" | 24 #include "cc/scoped_ptr_vector.h" |
| 25 #include "third_party/skia/include/core/SkColor.h" | 25 #include "third_party/skia/include/core/SkColor.h" |
| 26 #include <public/WebThread.h> | |
|
jamesr
2012/10/22 22:00:36
this isn't good - we should be removing WebKit dep
| |
| 26 | 27 |
| 27 #if defined(COMPILER_GCC) | 28 #if defined(COMPILER_GCC) |
| 28 namespace BASE_HASH_NAMESPACE { | 29 namespace BASE_HASH_NAMESPACE { |
| 29 template<> | 30 template<> |
| 30 struct hash<WebKit::WebGraphicsContext3D*> { | 31 struct hash<WebKit::WebGraphicsContext3D*> { |
| 31 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { | 32 size_t operator()(WebKit::WebGraphicsContext3D* ptr) const { |
| 32 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); | 33 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); |
| 33 } | 34 } |
| 34 }; | 35 }; |
| 35 } // namespace BASE_HASH_NAMESPACE | 36 } // namespace BASE_HASH_NAMESPACE |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 bool usingSetVisibility; | 84 bool usingSetVisibility; |
| 84 bool usingSwapCompleteCallback; | 85 bool usingSwapCompleteCallback; |
| 85 bool usingGpuMemoryManager; | 86 bool usingGpuMemoryManager; |
| 86 bool usingDiscardFramebuffer; | 87 bool usingDiscardFramebuffer; |
| 87 bool usingEglImage; | 88 bool usingEglImage; |
| 88 int maxTextureSize; | 89 int maxTextureSize; |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 class CCLayerTreeHost : public RateLimiterClient { | 92 class CCLayerTreeHost : public RateLimiterClient { |
| 92 public: | 93 public: |
| 93 static scoped_ptr<CCLayerTreeHost> create(CCLayerTreeHostClient*, const CCLa yerTreeSettings&); | 94 static scoped_ptr<CCLayerTreeHost> create(CCLayerTreeHostClient*, const CCLa yerTreeSettings&, CompositorSupportState*); |
| 94 virtual ~CCLayerTreeHost(); | 95 virtual ~CCLayerTreeHost(); |
| 95 | 96 |
| 96 void setSurfaceReady(); | 97 void setSurfaceReady(); |
| 97 | 98 |
| 98 // Returns true if any CCLayerTreeHost is alive. | 99 // Returns true if any CCLayerTreeHost is alive. |
| 99 static bool anyLayerTreeHostInstanceExists(); | 100 static bool anyLayerTreeHostInstanceExists(); |
| 100 | 101 |
| 101 static bool needsFilterContext() { return s_needsFilterContext; } | 102 static bool needsFilterContext() { return s_needsFilterContext; } |
| 102 static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterCo ntext = needsFilterContext; } | 103 static void setNeedsFilterContext(bool needsFilterContext) { s_needsFilterCo ntext = needsFilterContext; } |
| 103 bool needsSharedContext() const { return needsFilterContext() || settings(). acceleratePainting; } | 104 bool needsSharedContext() const { return needsFilterContext() || settings(). acceleratePainting; } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 bool requestPartialTextureUpdate(); | 198 bool requestPartialTextureUpdate(); |
| 198 void deleteTextureAfterCommit(scoped_ptr<CCPrioritizedTexture>); | 199 void deleteTextureAfterCommit(scoped_ptr<CCPrioritizedTexture>); |
| 199 | 200 |
| 200 void setDeviceScaleFactor(float); | 201 void setDeviceScaleFactor(float); |
| 201 float deviceScaleFactor() const { return m_deviceScaleFactor; } | 202 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
| 202 | 203 |
| 203 void setFontAtlas(scoped_ptr<CCFontAtlas>); | 204 void setFontAtlas(scoped_ptr<CCFontAtlas>); |
| 204 | 205 |
| 205 HeadsUpDisplayLayerChromium* hudLayer() const { return m_hudLayer.get(); } | 206 HeadsUpDisplayLayerChromium* hudLayer() const { return m_hudLayer.get(); } |
| 206 | 207 |
| 208 CCProxy* proxy() const { return m_proxy.get(); } | |
| 209 | |
| 207 protected: | 210 protected: |
| 208 CCLayerTreeHost(CCLayerTreeHostClient*, const CCLayerTreeSettings&); | 211 CCLayerTreeHost(CCLayerTreeHostClient*, const CCLayerTreeSettings&); |
| 209 bool initialize(); | 212 bool initialize(WebKit::WebThread* compositorThread); |
| 210 | 213 |
| 211 private: | 214 private: |
| 212 typedef std::vector<scoped_refptr<LayerChromium> > LayerList; | 215 typedef std::vector<scoped_refptr<LayerChromium> > LayerList; |
| 213 | 216 |
| 214 void initializeRenderer(); | 217 void initializeRenderer(); |
| 215 | 218 |
| 216 void update(LayerChromium*, CCTextureUpdateQueue&, const CCOcclusionTracker* ); | 219 void update(LayerChromium*, CCTextureUpdateQueue&, const CCOcclusionTracker* ); |
| 217 bool paintLayerContents(const LayerList&, CCTextureUpdateQueue&); | 220 bool paintLayerContents(const LayerList&, CCTextureUpdateQueue&); |
| 218 bool paintMasksForRenderSurface(LayerChromium*, CCTextureUpdateQueue&); | 221 bool paintMasksForRenderSurface(LayerChromium*, CCTextureUpdateQueue&); |
| 219 | 222 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 size_t m_partialTextureUpdateRequests; | 276 size_t m_partialTextureUpdateRequests; |
| 274 | 277 |
| 275 static bool s_needsFilterContext; | 278 static bool s_needsFilterContext; |
| 276 | 279 |
| 277 DISALLOW_COPY_AND_ASSIGN(CCLayerTreeHost); | 280 DISALLOW_COPY_AND_ASSIGN(CCLayerTreeHost); |
| 278 }; | 281 }; |
| 279 | 282 |
| 280 } // namespace cc | 283 } // namespace cc |
| 281 | 284 |
| 282 #endif | 285 #endif |
| OLD | NEW |