OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
10 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
11 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
12 | 13 |
13 class SkCanvas; | 14 class SkCanvas; |
14 | 15 |
15 namespace gfx { | 16 namespace gfx { |
16 class GLSurface; | 17 class GLSurface; |
17 class Transform; | 18 class Transform; |
18 }; | 19 }; |
19 | 20 |
(...skipping 25 matching lines...) Expand all Loading... |
45 // instance as needed, but only if |client| is non-NULL. | 46 // instance as needed, but only if |client| is non-NULL. |
46 static void SetClientForWebContents(WebContents* contents, | 47 static void SetClientForWebContents(WebContents* contents, |
47 SynchronousCompositorClient* client); | 48 SynchronousCompositorClient* client); |
48 | 49 |
49 // Allows changing or resetting the client to NULL (this must be used if | 50 // Allows changing or resetting the client to NULL (this must be used if |
50 // the client is being deleted prior to the DidDestroyCompositor() call | 51 // the client is being deleted prior to the DidDestroyCompositor() call |
51 // being received by the client). Ownership of |client| remains with | 52 // being received by the client). Ownership of |client| remains with |
52 // the caller. | 53 // the caller. |
53 virtual void SetClient(SynchronousCompositorClient* client) = 0; | 54 virtual void SetClient(SynchronousCompositorClient* client) = 0; |
54 | 55 |
| 56 static void SetGpuService( |
| 57 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
| 58 |
55 // Synchronously initialize compositor for hardware draw. Can only be called | 59 // Synchronously initialize compositor for hardware draw. Can only be called |
56 // while compositor is in software only mode, either after compositor is | 60 // while compositor is in software only mode, either after compositor is |
57 // first created or after ReleaseHwDraw is called. It is invalid to | 61 // first created or after ReleaseHwDraw is called. It is invalid to |
58 // DemandDrawHw before this returns true. |surface| is the GLSurface that | 62 // DemandDrawHw before this returns true. |surface| is the GLSurface that |
59 // should be used to create the underlying hardware context. | 63 // should be used to create the underlying hardware context. |
60 virtual bool InitializeHwDraw(scoped_refptr<gfx::GLSurface> surface) = 0; | 64 virtual bool InitializeHwDraw(scoped_refptr<gfx::GLSurface> surface) = 0; |
61 | 65 |
62 // Reverse of InitializeHwDraw above. Can only be called while hardware draw | 66 // Reverse of InitializeHwDraw above. Can only be called while hardware draw |
63 // is already initialized. Brings compositor back to software only mode and | 67 // is already initialized. Brings compositor back to software only mode and |
64 // releases all hardware resources. | 68 // releases all hardware resources. |
(...skipping 22 matching lines...) Expand all Loading... |
87 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). | 91 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). |
88 virtual void DidChangeRootLayerScrollOffset() = 0; | 92 virtual void DidChangeRootLayerScrollOffset() = 0; |
89 | 93 |
90 protected: | 94 protected: |
91 virtual ~SynchronousCompositor() {} | 95 virtual ~SynchronousCompositor() {} |
92 }; | 96 }; |
93 | 97 |
94 } // namespace content | 98 } // namespace content |
95 | 99 |
96 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 100 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
OLD | NEW |