Chromium Code Reviews| 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/callback.h" | |
| 8 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 9 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 10 #include "gpu/command_buffer/service/in_process_command_buffer.h" | 11 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 12 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | |
| 11 #include "ui/gfx/geometry/rect.h" | 13 #include "ui/gfx/geometry/rect.h" |
| 12 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
| 13 | 15 |
| 14 class SkCanvas; | 16 class SkCanvas; |
| 15 | 17 |
| 16 namespace cc { | 18 namespace cc { |
| 17 class CompositorFrame; | 19 class CompositorFrame; |
| 18 class CompositorFrameAck; | 20 class CompositorFrameAck; |
| 21 class ContextProvider; | |
| 19 } | 22 } |
| 20 | 23 |
| 21 namespace gfx { | 24 namespace gfx { |
| 22 class Transform; | 25 class Transform; |
| 23 }; | |
| 24 | |
| 25 namespace gpu { | |
| 26 class GLInProcessContext; | |
| 27 } | 26 } |
| 28 | 27 |
| 29 namespace content { | 28 namespace content { |
| 30 | 29 |
| 31 class SynchronousCompositorClient; | 30 class SynchronousCompositorClient; |
| 32 class WebContents; | 31 class WebContents; |
| 33 | 32 |
| 34 // Interface for embedders that wish to direct compositing operations | 33 // Interface for embedders that wish to direct compositing operations |
| 35 // synchronously under their own control. Only meaningful when the | 34 // synchronously under their own control. Only meaningful when the |
| 36 // kEnableSyncrhonousRendererCompositor flag is specified. | 35 // kEnableSyncrhonousRendererCompositor flag is specified. |
| 37 class CONTENT_EXPORT SynchronousCompositor { | 36 class CONTENT_EXPORT SynchronousCompositor { |
| 38 public: | 37 public: |
| 39 // Must be called once per WebContents instance. Will create the compositor | 38 // Must be called once per WebContents instance. Will create the compositor |
| 40 // instance as needed, but only if |client| is non-nullptr. | 39 // instance as needed, but only if |client| is non-nullptr. |
| 41 static void SetClientForWebContents(WebContents* contents, | 40 static void SetClientForWebContents(WebContents* contents, |
| 42 SynchronousCompositorClient* client); | 41 SynchronousCompositorClient* client); |
| 43 | 42 |
| 43 typedef base::Callback< | |
| 44 cc::ContextProvider(bool, blink::WebGraphicsContext3D::Attributes, bool)> | |
| 45 CreateContextCallback; | |
|
boliu
2015/02/11 16:52:41
Return type should be a struct like below (since t
| |
| 46 static void SetCreateContextCallback(CreateContextCallback callback); | |
| 47 | |
| 44 static void SetGpuService( | 48 static void SetGpuService( |
| 45 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); | 49 scoped_refptr<gpu::InProcessCommandBuffer::Service> service); |
| 46 | 50 |
| 47 // By default, synchronous compopsitor records the full layer, not only | 51 // By default, synchronous compopsitor records the full layer, not only |
| 48 // what is inside and around the view port. This can be used to switch | 52 // what is inside and around the view port. This can be used to switch |
| 49 // between this record-full-layer behavior and normal record-around-viewport | 53 // between this record-full-layer behavior and normal record-around-viewport |
| 50 // behavior. | 54 // behavior. |
| 51 static void SetRecordFullDocument(bool record_full_document); | 55 static void SetRecordFullDocument(bool record_full_document); |
| 52 | 56 |
| 53 // Synchronously initialize compositor for hardware draw. Can only be called | 57 // Synchronously initialize compositor for hardware draw. Can only be called |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |