| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_COMPOSITOR_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 12 #include "ui/gfx/size.h" | 12 #include "ui/gfx/size.h" |
| 13 | 13 |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 15 | 15 |
| 16 namespace cc { |
| 17 class Layer; |
| 18 } |
| 19 |
| 16 namespace gfx { | 20 namespace gfx { |
| 17 class JavaBitmap; | 21 class JavaBitmap; |
| 18 } | 22 } |
| 19 | 23 |
| 20 namespace WebKit { | |
| 21 class WebLayer; | |
| 22 } | |
| 23 | |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 // An interface to the browser-side compositor. | 26 // An interface to the browser-side compositor. |
| 27 class CONTENT_EXPORT Compositor { | 27 class CONTENT_EXPORT Compositor { |
| 28 public: | 28 public: |
| 29 class Client { | 29 class Client { |
| 30 public: | 30 public: |
| 31 // Tells the client that it should schedule a composite. | 31 // Tells the client that it should schedule a composite. |
| 32 virtual void ScheduleComposite() = 0; | 32 virtual void ScheduleComposite() = 0; |
| 33 | 33 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 // Initialize with flags. This should only be called once instead | 53 // Initialize with flags. This should only be called once instead |
| 54 // of Initialize(). | 54 // of Initialize(). |
| 55 static void InitializeWithFlags(uint32 flags); | 55 static void InitializeWithFlags(uint32 flags); |
| 56 | 56 |
| 57 // Creates and returns a compositor instance. | 57 // Creates and returns a compositor instance. |
| 58 static Compositor* Create(Client* client); | 58 static Compositor* Create(Client* client); |
| 59 | 59 |
| 60 // Attaches the layer tree. | 60 // Attaches the layer tree. |
| 61 virtual void SetRootLayer(WebKit::WebLayer* root) = 0; | 61 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) = 0; |
| 62 | 62 |
| 63 // Set the output surface bounds. | 63 // Set the output surface bounds. |
| 64 virtual void SetWindowBounds(const gfx::Size& size) = 0; | 64 virtual void SetWindowBounds(const gfx::Size& size) = 0; |
| 65 | 65 |
| 66 // Sets the window visibility. When becoming invisible, resources will get | 66 // Sets the window visibility. When becoming invisible, resources will get |
| 67 // freed and other calls into the compositor are not allowed until after | 67 // freed and other calls into the compositor are not allowed until after |
| 68 // having been made visible again. | 68 // having been made visible again. |
| 69 virtual void SetVisible(bool visible) = 0; | 69 virtual void SetVisible(bool visible) = 0; |
| 70 | 70 |
| 71 // Set the output surface handle which the compositor renders into. | 71 // Set the output surface handle which the compositor renders into. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 96 // done. It is assumed that the texture size matches that of the bitmap. | 96 // done. It is assumed that the texture size matches that of the bitmap. |
| 97 virtual void CopyTextureToBitmap(WebKit::WebGLId texture_id, | 97 virtual void CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| 98 gfx::JavaBitmap& bitmap) = 0; | 98 gfx::JavaBitmap& bitmap) = 0; |
| 99 protected: | 99 protected: |
| 100 Compositor() {} | 100 Compositor() {} |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace content | 103 } // namespace content |
| 104 | 104 |
| 105 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 105 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| OLD | NEW |