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_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" |
8 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
10 #include "base/containers/scoped_ptr_hash_map.h" | 11 #include "base/containers/scoped_ptr_hash_map.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "cc/resources/ui_resource_client.h" | 13 #include "cc/resources/ui_resource_client.h" |
13 #include "cc/trees/layer_tree_host_client.h" | 14 #include "cc/trees/layer_tree_host_client.h" |
14 #include "cc/trees/layer_tree_host_single_thread_client.h" | 15 #include "cc/trees/layer_tree_host_single_thread_client.h" |
15 #include "content/browser/renderer_host/image_transport_factory_android.h" | 16 #include "content/browser/renderer_host/image_transport_factory_android.h" |
16 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
17 #include "content/public/browser/android/compositor.h" | 18 #include "content/public/browser/android/compositor.h" |
(...skipping 22 matching lines...) Expand all Loading... |
40 public cc::LayerTreeHostSingleThreadClient, | 41 public cc::LayerTreeHostSingleThreadClient, |
41 public ImageTransportFactoryAndroidObserver, | 42 public ImageTransportFactoryAndroidObserver, |
42 public ui::WindowAndroidCompositor { | 43 public ui::WindowAndroidCompositor { |
43 public: | 44 public: |
44 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); | 45 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); |
45 virtual ~CompositorImpl(); | 46 virtual ~CompositorImpl(); |
46 | 47 |
47 static bool IsInitialized(); | 48 static bool IsInitialized(); |
48 | 49 |
49 // Returns the Java Surface object for a given view surface id. | 50 // Returns the Java Surface object for a given view surface id. |
50 static jobject GetSurface(int surface_id); | 51 static base::android::ScopedJavaLocalRef<jobject> GetSurface(int surface_id); |
| 52 |
| 53 // Returns the Java Surface object for a given surface texture id. |
| 54 static base::android::ScopedJavaLocalRef<jobject> GetSurfaceTextureSurface( |
| 55 int surface_texture_id, |
| 56 int child_process_id); |
| 57 |
| 58 // Creates a surface texture and returns a surface texture id. Returns -1 on |
| 59 // failure. |
| 60 static int CreateSurfaceTexture(int child_process_id); |
| 61 |
| 62 // Destroy all surface textures associated with |child_process_id|. |
| 63 static void DestroyAllSurfaceTextures(int child_process_id); |
51 | 64 |
52 // Compositor implementation. | 65 // Compositor implementation. |
53 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; | 66 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; |
54 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; | 67 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; |
55 virtual void SetSurface(jobject surface) OVERRIDE; | 68 virtual void SetSurface(jobject surface) OVERRIDE; |
56 virtual void SetVisible(bool visible) OVERRIDE; | 69 virtual void SetVisible(bool visible) OVERRIDE; |
57 virtual void setDeviceScaleFactor(float factor) OVERRIDE; | 70 virtual void setDeviceScaleFactor(float factor) OVERRIDE; |
58 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; | 71 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; |
59 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; | 72 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; |
60 virtual bool CompositeAndReadback( | 73 virtual bool CompositeAndReadback( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 UIResourceMap ui_resource_map_; | 134 UIResourceMap ui_resource_map_; |
122 | 135 |
123 gfx::NativeWindow root_window_; | 136 gfx::NativeWindow root_window_; |
124 | 137 |
125 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 138 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
126 }; | 139 }; |
127 | 140 |
128 } // namespace content | 141 } // namespace content |
129 | 142 |
130 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 143 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |