| 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 CC_TREES_PROXY_H_ | 5 #ifndef CC_TREES_PROXY_H_ |
| 6 #define CC_TREES_PROXY_H_ | 6 #define CC_TREES_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/time.h" | 11 #include "base/time.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
| 14 #include "skia/ext/refptr.h" | 14 #include "skia/ext/refptr.h" |
| 15 #include "third_party/skia/include/core/SkPicture.h" | 15 #include "third_party/skia/include/core/SkPicture.h" |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 class Rect; | 18 class Rect; |
| 19 class Vector2d; | 19 class Vector2d; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 | 23 |
| 24 class Thread; | 24 class Thread; |
| 25 struct RenderingStats; | |
| 26 struct RendererCapabilities; | 25 struct RendererCapabilities; |
| 27 | 26 |
| 28 // Abstract class responsible for proxying commands from the main-thread side of | 27 // Abstract class responsible for proxying commands from the main-thread side of |
| 29 // the compositor over to the compositor implementation. | 28 // the compositor over to the compositor implementation. |
| 30 class CC_EXPORT Proxy { | 29 class CC_EXPORT Proxy { |
| 31 public: | 30 public: |
| 32 Thread* MainThread() const; | 31 Thread* MainThread() const; |
| 33 bool HasImplThread() const; | 32 bool HasImplThread() const; |
| 34 Thread* ImplThread() const; | 33 Thread* ImplThread() const; |
| 35 | 34 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 virtual void SetVisible(bool visible) = 0; | 70 virtual void SetVisible(bool visible) = 0; |
| 72 | 71 |
| 73 // Attempts to initialize the layer renderer. Returns false if the context | 72 // Attempts to initialize the layer renderer. Returns false if the context |
| 74 // isn't usable for compositing. | 73 // isn't usable for compositing. |
| 75 virtual bool InitializeRenderer() = 0; | 74 virtual bool InitializeRenderer() = 0; |
| 76 | 75 |
| 77 // Attempts to recreate the context and layer renderer after a context lost. | 76 // Attempts to recreate the context and layer renderer after a context lost. |
| 78 // Returns false if the renderer couldn't be reinitialized. | 77 // Returns false if the renderer couldn't be reinitialized. |
| 79 virtual bool RecreateOutputSurface() = 0; | 78 virtual bool RecreateOutputSurface() = 0; |
| 80 | 79 |
| 81 virtual void CollectRenderingStats(RenderingStats* stats) = 0; | |
| 82 | |
| 83 virtual const RendererCapabilities& GetRendererCapabilities() const = 0; | 80 virtual const RendererCapabilities& GetRendererCapabilities() const = 0; |
| 84 | 81 |
| 85 virtual void SetNeedsAnimate() = 0; | 82 virtual void SetNeedsAnimate() = 0; |
| 86 virtual void SetNeedsCommit() = 0; | 83 virtual void SetNeedsCommit() = 0; |
| 87 virtual void SetNeedsRedraw() = 0; | 84 virtual void SetNeedsRedraw() = 0; |
| 88 | 85 |
| 89 // Defers commits until it is reset. It is only supported when in threaded | 86 // Defers commits until it is reset. It is only supported when in threaded |
| 90 // mode. It's an error to make a sync call like compositeAndReadback while | 87 // mode. It's an error to make a sync call like compositeAndReadback while |
| 91 // commits are deferred. | 88 // commits are deferred. |
| 92 virtual void SetDeferCommits(bool defer_commits) = 0; | 89 virtual void SetDeferCommits(bool defer_commits) = 0; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 class DebugScopedSetMainThreadBlocked { | 145 class DebugScopedSetMainThreadBlocked { |
| 149 public: | 146 public: |
| 150 explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) {} | 147 explicit DebugScopedSetMainThreadBlocked(Proxy* proxy) {} |
| 151 ~DebugScopedSetMainThreadBlocked() {} | 148 ~DebugScopedSetMainThreadBlocked() {} |
| 152 }; | 149 }; |
| 153 #endif | 150 #endif |
| 154 | 151 |
| 155 } | 152 } |
| 156 | 153 |
| 157 #endif // CC_TREES_PROXY_H_ | 154 #endif // CC_TREES_PROXY_H_ |
| OLD | NEW |