| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/gfx/size.h" |
| 11 |
| 12 namespace WebKit { |
| 13 class WebLayer; |
| 14 } |
| 15 |
| 16 namespace content { |
| 17 |
| 18 // An interface to the browser-side compositor. |
| 19 class Compositor { |
| 20 public: |
| 21 virtual ~Compositor() {} |
| 22 |
| 23 // Performs the global initialization needed before any compositor |
| 24 // instance can be used. |
| 25 static void Initialize(); |
| 26 |
| 27 // Creates and returns a compositor instance. |
| 28 static Compositor* Create(); |
| 29 |
| 30 // Attaches the layer tree. |
| 31 virtual void SetRootLayer(WebKit::WebLayer* root) = 0; |
| 32 |
| 33 // Set the output surface bounds. |
| 34 virtual void SetWindowBounds(const gfx::Size& size) = 0; |
| 35 |
| 36 // Set the output surface handle which the compositor renders into. |
| 37 virtual void SetWindowSurface(ANativeWindow* window) = 0; |
| 38 |
| 39 // Callback to be run after the frame has been drawn. It passes back |
| 40 // a synchronization point identifier. |
| 41 typedef base::Callback<void(uint32)> SurfacePresentedCallback; |
| 42 |
| 43 virtual void OnSurfaceUpdated(const SurfacePresentedCallback& callback) = 0; |
| 44 |
| 45 protected: |
| 46 Compositor() {} |
| 47 }; |
| 48 |
| 49 } // namespace content |
| 50 |
| 51 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| OLD | NEW |