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" |
(...skipping 29 matching lines...) Expand all Loading... |
40 public ImageTransportFactoryAndroidObserver { | 40 public ImageTransportFactoryAndroidObserver { |
41 public: | 41 public: |
42 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); | 42 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); |
43 virtual ~CompositorImpl(); | 43 virtual ~CompositorImpl(); |
44 | 44 |
45 static bool IsInitialized(); | 45 static bool IsInitialized(); |
46 | 46 |
47 // Returns the Java Surface object for a given view surface id. | 47 // Returns the Java Surface object for a given view surface id. |
48 static jobject GetSurface(int surface_id); | 48 static jobject GetSurface(int surface_id); |
49 | 49 |
| 50 // Returns the Java Surface object for a given surface texture id. |
| 51 static jobject GetSurfaceTextureSurface(int render_process_id, |
| 52 int surface_texture_id); |
| 53 |
| 54 // Allocates a SurfaceTexture and returns a surface texture id. Returns -1 |
| 55 // on failure. |
| 56 static int AllocateSurfaceTexture(int render_process_id); |
| 57 |
50 // Compositor implementation. | 58 // Compositor implementation. |
51 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; | 59 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; |
52 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; | 60 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; |
53 virtual void SetSurface(jobject surface) OVERRIDE; | 61 virtual void SetSurface(jobject surface) OVERRIDE; |
54 virtual void SetVisible(bool visible) OVERRIDE; | 62 virtual void SetVisible(bool visible) OVERRIDE; |
55 virtual void setDeviceScaleFactor(float factor) OVERRIDE; | 63 virtual void setDeviceScaleFactor(float factor) OVERRIDE; |
56 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; | 64 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; |
57 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; | 65 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; |
58 virtual bool CompositeAndReadback( | 66 virtual bool CompositeAndReadback( |
59 void *pixels, const gfx::Rect& rect) OVERRIDE; | 67 void *pixels, const gfx::Rect& rect) OVERRIDE; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 UIResourceMap ui_resource_map_; | 124 UIResourceMap ui_resource_map_; |
117 | 125 |
118 gfx::NativeWindow root_window_; | 126 gfx::NativeWindow root_window_; |
119 | 127 |
120 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 128 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
121 }; | 129 }; |
122 | 130 |
123 } // namespace content | 131 } // namespace content |
124 | 132 |
125 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 133 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |