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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/containers/scoped_ptr_hash_map.h" | 10 #include "base/containers/scoped_ptr_hash_map.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/process/process_handle.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" |
18 #include "third_party/khronos/GLES2/gl2.h" | 19 #include "third_party/khronos/GLES2/gl2.h" |
19 #include "ui/base/android/window_android_compositor.h" | 20 #include "ui/base/android/window_android_compositor.h" |
20 | 21 |
21 class SkBitmap; | 22 class SkBitmap; |
(...skipping 20 matching lines...) Expand all Loading... |
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 jobject GetSurface(int surface_id); |
51 | 52 |
| 53 // Returns the Java Surface object for a given surface texture id. |
| 54 static jobject GetSurfaceTextureSurface(int surface_texture_id, |
| 55 base::ProcessHandle process_handle); |
| 56 |
| 57 // Allocates a surface texture and returns a surface texture id. Returns -1 on |
| 58 // failure. |
| 59 static int AllocateSurfaceTexture(base::ProcessHandle process_handle); |
| 60 |
| 61 // Destroy all surface textures associated with |process_handle|. |
| 62 static void DestroyAllSurfaceTextures(base::ProcessHandle process_handle); |
| 63 |
52 // Compositor implementation. | 64 // Compositor implementation. |
53 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; | 65 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; |
54 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; | 66 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; |
55 virtual void SetSurface(jobject surface) OVERRIDE; | 67 virtual void SetSurface(jobject surface) OVERRIDE; |
56 virtual void SetVisible(bool visible) OVERRIDE; | 68 virtual void SetVisible(bool visible) OVERRIDE; |
57 virtual void setDeviceScaleFactor(float factor) OVERRIDE; | 69 virtual void setDeviceScaleFactor(float factor) OVERRIDE; |
58 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; | 70 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; |
59 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; | 71 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; |
60 virtual bool CompositeAndReadback( | 72 virtual bool CompositeAndReadback( |
61 void *pixels, const gfx::Rect& rect) OVERRIDE; | 73 void *pixels, const gfx::Rect& rect) OVERRIDE; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 UIResourceMap ui_resource_map_; | 133 UIResourceMap ui_resource_map_; |
122 | 134 |
123 gfx::NativeWindow root_window_; | 135 gfx::NativeWindow root_window_; |
124 | 136 |
125 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 137 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
126 }; | 138 }; |
127 | 139 |
128 } // namespace content | 140 } // namespace content |
129 | 141 |
130 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 142 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |