| 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" | |
| 11 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 13 #include "cc/resources/ui_resource_client.h" | |
| 14 #include "cc/trees/layer_tree_host_client.h" | 12 #include "cc/trees/layer_tree_host_client.h" |
| 15 #include "content/browser/renderer_host/image_transport_factory_android.h" | 13 #include "content/browser/renderer_host/image_transport_factory_android.h" |
| 16 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 17 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 15 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 18 #include "content/public/browser/android/compositor.h" | 16 #include "content/public/browser/android/compositor.h" |
| 19 | 17 |
| 20 struct ANativeWindow; | 18 struct ANativeWindow; |
| 21 | 19 |
| 22 namespace cc { | 20 namespace cc { |
| 23 class InputHandlerClient; | 21 class InputHandlerClient; |
| 24 class Layer; | 22 class Layer; |
| 25 class LayerTreeHost; | 23 class LayerTreeHost; |
| 26 class ScopedUIResource; | |
| 27 } | 24 } |
| 28 | 25 |
| 29 namespace content { | 26 namespace content { |
| 30 class CompositorClient; | 27 class CompositorClient; |
| 31 class GraphicsContext; | 28 class GraphicsContext; |
| 32 | 29 |
| 33 // ----------------------------------------------------------------------------- | 30 // ----------------------------------------------------------------------------- |
| 34 // Browser-side compositor that manages a tree of content and UI layers. | 31 // Browser-side compositor that manages a tree of content and UI layers. |
| 35 // ----------------------------------------------------------------------------- | 32 // ----------------------------------------------------------------------------- |
| 36 class CONTENT_EXPORT CompositorImpl | 33 class CONTENT_EXPORT CompositorImpl |
| (...skipping 19 matching lines...) Expand all Loading... |
| 56 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; | 53 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; |
| 57 virtual void SetSurface(jobject surface) OVERRIDE; | 54 virtual void SetSurface(jobject surface) OVERRIDE; |
| 58 virtual void SetVisible(bool visible) OVERRIDE; | 55 virtual void SetVisible(bool visible) OVERRIDE; |
| 59 virtual void setDeviceScaleFactor(float factor) OVERRIDE; | 56 virtual void setDeviceScaleFactor(float factor) OVERRIDE; |
| 60 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; | 57 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; |
| 61 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; | 58 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; |
| 62 virtual bool CompositeAndReadback( | 59 virtual bool CompositeAndReadback( |
| 63 void *pixels, const gfx::Rect& rect) OVERRIDE; | 60 void *pixels, const gfx::Rect& rect) OVERRIDE; |
| 64 virtual void SetNeedsRedraw() OVERRIDE; | 61 virtual void SetNeedsRedraw() OVERRIDE; |
| 65 virtual void Composite() OVERRIDE; | 62 virtual void Composite() OVERRIDE; |
| 66 virtual cc::UIResourceId GenerateUIResource( | |
| 67 const cc::UIResourceBitmap& bitmap) OVERRIDE; | |
| 68 virtual void DeleteUIResource(cc::UIResourceId resource_id) OVERRIDE; | |
| 69 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE; | 63 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE; |
| 70 virtual WebKit::WebGLId GenerateCompressedTexture( | 64 virtual WebKit::WebGLId GenerateCompressedTexture( |
| 71 gfx::Size& size, int data_size, void* data) OVERRIDE; | 65 gfx::Size& size, int data_size, void* data) OVERRIDE; |
| 72 virtual void DeleteTexture(WebKit::WebGLId texture_id) OVERRIDE; | 66 virtual void DeleteTexture(WebKit::WebGLId texture_id) OVERRIDE; |
| 73 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, | 67 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| 74 gfx::JavaBitmap& bitmap) OVERRIDE; | 68 gfx::JavaBitmap& bitmap) OVERRIDE; |
| 75 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, | 69 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| 76 const gfx::Rect& sub_rect, | 70 const gfx::Rect& sub_rect, |
| 77 gfx::JavaBitmap& bitmap) OVERRIDE; | 71 gfx::JavaBitmap& bitmap) OVERRIDE; |
| 78 | 72 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 bool has_transparent_background_; | 110 bool has_transparent_background_; |
| 117 | 111 |
| 118 ANativeWindow* window_; | 112 ANativeWindow* window_; |
| 119 int surface_id_; | 113 int surface_id_; |
| 120 | 114 |
| 121 CompositorClient* client_; | 115 CompositorClient* client_; |
| 122 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 116 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
| 123 | 117 |
| 124 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; | 118 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; |
| 125 | 119 |
| 126 typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::ScopedUIResource> | |
| 127 UIResourceMap; | |
| 128 UIResourceMap ui_resource_map_; | |
| 129 | |
| 130 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 120 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
| 131 }; | 121 }; |
| 132 | 122 |
| 133 } // namespace content | 123 } // namespace content |
| 134 | 124 |
| 135 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 125 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
| OLD | NEW |