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