| 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 "cc/resources/ui_resource_bitmap.h" | 9 #include "cc/resources/ui_resource_bitmap.h" |
| 10 #include "cc/resources/ui_resource_client.h" | 10 #include "cc/resources/ui_resource_client.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 // An interface to the browser-side compositor. | 29 // An interface to the browser-side compositor. |
| 30 class CONTENT_EXPORT Compositor { | 30 class CONTENT_EXPORT Compositor { |
| 31 public: | 31 public: |
| 32 virtual ~Compositor() {} | 32 virtual ~Compositor() {} |
| 33 | 33 |
| 34 // Performs the global initialization needed before any compositor | 34 // Performs the global initialization needed before any compositor |
| 35 // instance can be used. This should be called only once. | 35 // instance can be used. This should be called only once. |
| 36 static void Initialize(); | 36 static void Initialize(); |
| 37 | 37 |
| 38 // Creates and returns a compositor instance. | 38 // Creates and returns a compositor instance. |root_window| needs to outlive |
| 39 static Compositor* Create(CompositorClient* client); | 39 // the compositor as it manages callbacks on the compositor. |
| 40 static Compositor* Create(CompositorClient* client, |
| 41 gfx::NativeWindow root_window); |
| 40 | 42 |
| 41 // Attaches the layer tree. | 43 // Attaches the layer tree. |
| 42 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) = 0; | 44 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) = 0; |
| 43 | 45 |
| 44 // Set the scale factor from DIP to pixel. | 46 // Set the scale factor from DIP to pixel. |
| 45 virtual void setDeviceScaleFactor(float factor) = 0; | 47 virtual void setDeviceScaleFactor(float factor) = 0; |
| 46 | 48 |
| 47 // Set the output surface bounds. | 49 // Set the output surface bounds. |
| 48 virtual void SetWindowBounds(const gfx::Size& size) = 0; | 50 virtual void SetWindowBounds(const gfx::Size& size) = 0; |
| 49 | 51 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, | 101 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, |
| 100 const gfx::Rect& src_rect, | 102 const gfx::Rect& src_rect, |
| 101 gfx::JavaBitmap& bitmap) = 0; | 103 gfx::JavaBitmap& bitmap) = 0; |
| 102 protected: | 104 protected: |
| 103 Compositor() {} | 105 Compositor() {} |
| 104 }; | 106 }; |
| 105 | 107 |
| 106 } // namespace content | 108 } // namespace content |
| 107 | 109 |
| 108 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 110 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| OLD | NEW |