Chromium Code Reviews| 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" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
| 14 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
| 15 | 15 |
| 16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 16 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 17 | 17 |
| 18 namespace cc { | 18 namespace cc { |
| 19 class Layer; | 19 class Layer; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace gfx { | 22 namespace gfx { |
| 23 class JavaBitmap; | 23 class JavaBitmap; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace ui { | |
| 27 class WindowAndroid; | |
| 28 } | |
| 29 | |
| 26 namespace content { | 30 namespace content { |
| 27 class CompositorClient; | 31 class CompositorClient; |
| 28 | 32 |
| 29 // An interface to the browser-side compositor. | 33 // An interface to the browser-side compositor. |
| 30 class CONTENT_EXPORT Compositor { | 34 class CONTENT_EXPORT Compositor { |
| 31 public: | 35 public: |
| 32 virtual ~Compositor() {} | 36 virtual ~Compositor() {} |
| 33 | 37 |
| 34 // Performs the global initialization needed before any compositor | 38 // Performs the global initialization needed before any compositor |
| 35 // instance can be used. This should be called only once. | 39 // instance can be used. This should be called only once. |
| 36 static void Initialize(); | 40 static void Initialize(); |
| 37 | 41 |
| 38 // Creates and returns a compositor instance. | 42 // Creates and returns a compositor instance. |
| 39 static Compositor* Create(CompositorClient* client); | 43 static Compositor* Create(CompositorClient* client, |
| 44 ui::WindowAndroid* window_android); | |
|
no sievers
2013/11/14 22:01:01
nit: |root_window|? Can you also use the common ty
powei
2013/11/15 02:18:26
Done.
| |
| 40 | 45 |
| 41 // Attaches the layer tree. | 46 // Attaches the layer tree. |
| 42 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) = 0; | 47 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) = 0; |
| 43 | 48 |
| 44 // Set the scale factor from DIP to pixel. | 49 // Set the scale factor from DIP to pixel. |
| 45 virtual void setDeviceScaleFactor(float factor) = 0; | 50 virtual void setDeviceScaleFactor(float factor) = 0; |
| 46 | 51 |
| 47 // Set the output surface bounds. | 52 // Set the output surface bounds. |
| 48 virtual void SetWindowBounds(const gfx::Size& size) = 0; | 53 virtual void SetWindowBounds(const gfx::Size& size) = 0; |
| 49 | 54 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, | 104 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, |
| 100 const gfx::Rect& src_rect, | 105 const gfx::Rect& src_rect, |
| 101 gfx::JavaBitmap& bitmap) = 0; | 106 gfx::JavaBitmap& bitmap) = 0; |
| 102 protected: | 107 protected: |
| 103 Compositor() {} | 108 Compositor() {} |
| 104 }; | 109 }; |
| 105 | 110 |
| 106 } // namespace content | 111 } // namespace content |
| 107 | 112 |
| 108 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ | 113 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_COMPOSITOR_H_ |
| OLD | NEW |