| 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" |
| 11 #include <public/WebCompositorOutputSurface.h> | 11 #include <public/WebCompositorOutputSurface.h> |
| 12 #include "cc/cc_export.h" | 12 #include "cc/cc_export.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Rect; | 15 class Rect; |
| 16 class Vector2d; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace cc { | 19 namespace cc { |
| 19 | 20 |
| 20 class Thread; | 21 class Thread; |
| 21 class IntSize; | |
| 22 struct RenderingStats; | 22 struct RenderingStats; |
| 23 struct RendererCapabilities; | 23 struct RendererCapabilities; |
| 24 | 24 |
| 25 // Abstract class responsible for proxying commands from the main-thread side of | 25 // Abstract class responsible for proxying commands from the main-thread side of |
| 26 // the compositor over to the compositor implementation. | 26 // the compositor over to the compositor implementation. |
| 27 class CC_EXPORT Proxy { | 27 class CC_EXPORT Proxy { |
| 28 public: | 28 public: |
| 29 static void setMainThread(Thread*); | 29 static void setMainThread(Thread*); |
| 30 static Thread* mainThread(); | 30 static Thread* mainThread(); |
| 31 | 31 |
| 32 static bool hasImplThread(); | 32 static bool hasImplThread(); |
| 33 static void setImplThread(Thread*); | 33 static void setImplThread(Thread*); |
| 34 static Thread* implThread(); | 34 static Thread* implThread(); |
| 35 | 35 |
| 36 // Returns 0 if the current thread is neither the main thread nor the impl t
hread. | 36 // Returns 0 if the current thread is neither the main thread nor the impl t
hread. |
| 37 static Thread* currentThread(); | 37 static Thread* currentThread(); |
| 38 | 38 |
| 39 virtual ~Proxy(); | 39 virtual ~Proxy(); |
| 40 | 40 |
| 41 virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) = 0; | 41 virtual bool compositeAndReadback(void *pixels, const gfx::Rect&) = 0; |
| 42 | 42 |
| 43 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool use
Anchor, float scale, base::TimeDelta duration) = 0; | 43 virtual void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnc
hor, float scale, base::TimeDelta duration) = 0; |
| 44 | 44 |
| 45 virtual void finishAllRendering() = 0; | 45 virtual void finishAllRendering() = 0; |
| 46 | 46 |
| 47 virtual bool isStarted() const = 0; | 47 virtual bool isStarted() const = 0; |
| 48 | 48 |
| 49 // Attempts to initialize a context to use for rendering. Returns false if t
he context could not be created. | 49 // Attempts to initialize a context to use for rendering. Returns false if t
he context could not be created. |
| 50 // The context will not be used and no frames may be produced until initiali
zeRenderer() is called. | 50 // The context will not be used and no frames may be produced until initiali
zeRenderer() is called. |
| 51 virtual bool initializeContext() = 0; | 51 virtual bool initializeContext() = 0; |
| 52 | 52 |
| 53 // Indicates that the compositing surface associated with our context is rea
dy to use. | 53 // Indicates that the compositing surface associated with our context is rea
dy to use. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 #ifndef NDEBUG | 128 #ifndef NDEBUG |
| 129 DCHECK(Proxy::isMainThreadBlocked()); | 129 DCHECK(Proxy::isMainThreadBlocked()); |
| 130 Proxy::setMainThreadBlocked(false); | 130 Proxy::setMainThreadBlocked(false); |
| 131 #endif | 131 #endif |
| 132 } | 132 } |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } | 135 } |
| 136 | 136 |
| 137 #endif // CC_PROXY_H_ | 137 #endif // CC_PROXY_H_ |
| OLD | NEW |