| 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 "content/common/content_export.h" |
| 8 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 9 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 10 | 11 |
| 11 class SkCanvas; | 12 class SkCanvas; |
| 12 | 13 |
| 13 namespace gfx { | 14 namespace gfx { |
| 14 class Transform; | 15 class Transform; |
| 15 }; | 16 }; |
| 16 | 17 |
| 17 namespace content { | 18 namespace content { |
| 18 | 19 |
| 19 class WebContents; | 20 class WebContents; |
| 20 | 21 |
| 21 class SynchronousCompositorClient; | 22 class SynchronousCompositorClient; |
| 22 | 23 |
| 23 // Interface for embedders that wish to direct compositing operations | 24 // Interface for embedders that wish to direct compositing operations |
| 24 // synchronously under their own control. Only meaningful when the | 25 // synchronously under their own control. Only meaningful when the |
| 25 // kEnableSyncrhonousRendererCompositor flag is specified. | 26 // kEnableSyncrhonousRendererCompositor flag is specified. |
| 26 class SynchronousCompositor { | 27 class CONTENT_EXPORT SynchronousCompositor { |
| 27 public: | 28 public: |
| 28 // Must be called once per WebContents instance. Will create the compositor | 29 // Must be called once per WebContents instance. Will create the compositor |
| 29 // instance as needed, but only if |client| is non-NULL. | 30 // instance as needed, but only if |client| is non-NULL. |
| 30 static void SetClientForWebContents(WebContents* contents, | 31 static void SetClientForWebContents(WebContents* contents, |
| 31 SynchronousCompositorClient* client); | 32 SynchronousCompositorClient* client); |
| 32 | 33 |
| 33 // Allows changing or resetting the client to NULL (this must be used if | 34 // Allows changing or resetting the client to NULL (this must be used if |
| 34 // the client is being deleted prior to the DidDestroyCompositor() call | 35 // the client is being deleted prior to the DidDestroyCompositor() call |
| 35 // being received by the client). Ownership of |client| remains with | 36 // being received by the client). Ownership of |client| remains with |
| 36 // the caller. | 37 // the caller. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 56 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). | 57 // SynchronousCompositorClient::GetTotalRootLayerScrollOffset). |
| 57 virtual void DidChangeRootLayerScrollOffset() = 0; | 58 virtual void DidChangeRootLayerScrollOffset() = 0; |
| 58 | 59 |
| 59 protected: | 60 protected: |
| 60 virtual ~SynchronousCompositor() {} | 61 virtual ~SynchronousCompositor() {} |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 } // namespace content | 64 } // namespace content |
| 64 | 65 |
| 65 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ | 66 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_SYNCHRONOUS_COMPOSITOR_H_ |
| OLD | NEW |