| 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_PROXY_H_ | 5 #ifndef CC_PROXY_H_ |
| 6 #define CC_PROXY_H_ | 6 #define CC_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/time.h" | 10 #include "base/time.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) = 0; | 48 virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) = 0; |
| 49 | 49 |
| 50 virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnc
hor, float scale, base::TimeDelta duration) = 0; | 50 virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnc
hor, float scale, base::TimeDelta duration) = 0; |
| 51 | 51 |
| 52 virtual void finishAllRendering() = 0; | 52 virtual void finishAllRendering() = 0; |
| 53 | 53 |
| 54 virtual bool isStarted() const = 0; | 54 virtual bool isStarted() const = 0; |
| 55 | 55 |
| 56 // Attempts to initialize a context to use for rendering. Returns false if t
he context could not be created. | 56 // Attempts to initialize a context to use for rendering. Returns false if t
he context could not be created. |
| 57 // The context will not be used and no frames may be produced until initiali
zeRenderer() is called. | 57 // The context will not be used and no frames may be produced until initiali
zeRenderer() is called. |
| 58 virtual bool initializeOutputSurface() = 0; | 58 virtual bool initializeContext() = 0; |
| 59 | 59 |
| 60 // Indicates that the compositing surface associated with our context is rea
dy to use. | 60 // Indicates that the compositing surface associated with our context is rea
dy to use. |
| 61 virtual void setSurfaceReady() = 0; | 61 virtual void setSurfaceReady() = 0; |
| 62 | 62 |
| 63 virtual void setVisible(bool) = 0; | 63 virtual void setVisible(bool) = 0; |
| 64 | 64 |
| 65 // Attempts to initialize the layer renderer. Returns false if the context i
sn't usable for compositing. | 65 // Attempts to initialize the layer renderer. Returns false if the context i
sn't usable for compositing. |
| 66 virtual bool initializeRenderer() = 0; | 66 virtual bool initializeRenderer() = 0; |
| 67 | 67 |
| 68 // Attempts to recreate the context and layer renderer after a context lost.
Returns false if the renderer couldn't be | 68 // Attempts to recreate the context and layer renderer after a context lost.
Returns false if the renderer couldn't be |
| 69 // reinitialized. | 69 // reinitialized. |
| 70 virtual bool recreateOutputSurface() = 0; | 70 virtual bool recreateContext() = 0; |
| 71 | 71 |
| 72 virtual void renderingStats(RenderingStats*) = 0; | 72 virtual void renderingStats(RenderingStats*) = 0; |
| 73 | 73 |
| 74 virtual const RendererCapabilities& rendererCapabilities() const = 0; | 74 virtual const RendererCapabilities& rendererCapabilities() const = 0; |
| 75 | 75 |
| 76 virtual void setNeedsAnimate() = 0; | 76 virtual void setNeedsAnimate() = 0; |
| 77 virtual void setNeedsCommit() = 0; | 77 virtual void setNeedsCommit() = 0; |
| 78 virtual void setNeedsRedraw() = 0; | 78 virtual void setNeedsRedraw() = 0; |
| 79 | 79 |
| 80 // Defers commits until it is reset. It is only supported when in threaded m
ode. It's an error to make a sync call | 80 // Defers commits until it is reset. It is only supported when in threaded m
ode. It's an error to make a sync call |
| (...skipping 10 matching lines...) Expand all Loading... |
| 91 // Forces 3D commands on all contexts to wait for all previous SwapBuffers t
o finish before executing in the GPU | 91 // Forces 3D commands on all contexts to wait for all previous SwapBuffers t
o finish before executing in the GPU |
| 92 // process. | 92 // process. |
| 93 virtual void forceSerializeOnSwapBuffers() = 0; | 93 virtual void forceSerializeOnSwapBuffers() = 0; |
| 94 | 94 |
| 95 // Maximum number of sub-region texture updates supported for each commit. | 95 // Maximum number of sub-region texture updates supported for each commit. |
| 96 virtual size_t maxPartialTextureUpdates() const = 0; | 96 virtual size_t maxPartialTextureUpdates() const = 0; |
| 97 | 97 |
| 98 virtual void acquireLayerTextures() = 0; | 98 virtual void acquireLayerTextures() = 0; |
| 99 | 99 |
| 100 // Testing hooks | 100 // Testing hooks |
| 101 virtual void loseOutputSurface() = 0; | 101 virtual void loseContext() = 0; |
| 102 | 102 |
| 103 protected: | 103 protected: |
| 104 explicit Proxy(scoped_ptr<Thread> implThread); | 104 explicit Proxy(scoped_ptr<Thread> implThread); |
| 105 friend class DebugScopedSetImplThread; | 105 friend class DebugScopedSetImplThread; |
| 106 friend class DebugScopedSetMainThread; | 106 friend class DebugScopedSetMainThread; |
| 107 friend class DebugScopedSetMainThreadBlocked; | 107 friend class DebugScopedSetMainThreadBlocked; |
| 108 | 108 |
| 109 private: | 109 private: |
| 110 DISALLOW_COPY_AND_ASSIGN(Proxy); | 110 DISALLOW_COPY_AND_ASSIGN(Proxy); |
| 111 | 111 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 138 class DebugScopedSetMainThreadBlocked { | 138 class DebugScopedSetMainThreadBlocked { |
| 139 public: | 139 public: |
| 140 explicit DebugScopedSetMainThreadBlocked(Proxy*) { } | 140 explicit DebugScopedSetMainThreadBlocked(Proxy*) { } |
| 141 ~DebugScopedSetMainThreadBlocked() { } | 141 ~DebugScopedSetMainThreadBlocked() { } |
| 142 }; | 142 }; |
| 143 #endif | 143 #endif |
| 144 | 144 |
| 145 } | 145 } |
| 146 | 146 |
| 147 #endif // CC_PROXY_H_ | 147 #endif // CC_PROXY_H_ |
| OLD | NEW |