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/cancelable_callback.h" | 9 #include "base/cancelable_callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "cc/trees/layer_tree_host_client.h" | 13 #include "cc/trees/layer_tree_host_client.h" |
14 #include "cc/trees/layer_tree_host_single_thread_client.h" | 14 #include "cc/trees/layer_tree_host_single_thread_client.h" |
15 #include "content/browser/android/ui_resource_provider_impl.h" | 15 #include "content/browser/android/ui_resource_provider_impl.h" |
16 #include "content/browser/renderer_host/image_transport_factory_android.h" | 16 #include "content/browser/renderer_host/image_transport_factory_android.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
| 18 #include "content/common/gpu/client/context_provider_command_buffer.h" |
18 #include "content/public/browser/android/compositor.h" | 19 #include "content/public/browser/android/compositor.h" |
| 20 #include "gpu/command_buffer/common/capabilities.h" |
19 #include "third_party/khronos/GLES2/gl2.h" | 21 #include "third_party/khronos/GLES2/gl2.h" |
20 #include "ui/base/android/system_ui_resource_manager.h" | 22 #include "ui/base/android/system_ui_resource_manager.h" |
21 #include "ui/base/android/window_android_compositor.h" | 23 #include "ui/base/android/window_android_compositor.h" |
22 | 24 |
23 class SkBitmap; | 25 class SkBitmap; |
24 struct ANativeWindow; | 26 struct ANativeWindow; |
25 | 27 |
26 namespace cc { | 28 namespace cc { |
27 class Layer; | 29 class Layer; |
28 class LayerTreeHost; | 30 class LayerTreeHost; |
(...skipping 18 matching lines...) Expand all Loading... |
47 | 49 |
48 static bool IsInitialized(); | 50 static bool IsInitialized(); |
49 | 51 |
50 // Creates a surface texture and returns a surface texture id. Returns -1 on | 52 // Creates a surface texture and returns a surface texture id. Returns -1 on |
51 // failure. | 53 // failure. |
52 static int CreateSurfaceTexture(int child_process_id); | 54 static int CreateSurfaceTexture(int child_process_id); |
53 | 55 |
54 // Destroy all surface textures associated with |child_process_id|. | 56 // Destroy all surface textures associated with |child_process_id|. |
55 static void DestroyAllSurfaceTextures(int child_process_id); | 57 static void DestroyAllSurfaceTextures(int child_process_id); |
56 | 58 |
| 59 void PopulateGpuCapabilities(gpu::Capabilities gpu_capabilities); |
| 60 |
57 private: | 61 private: |
58 // Compositor implementation. | 62 // Compositor implementation. |
59 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; | 63 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) OVERRIDE; |
60 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; | 64 virtual void SetWindowSurface(ANativeWindow* window) OVERRIDE; |
61 virtual void SetSurface(jobject surface) OVERRIDE; | 65 virtual void SetSurface(jobject surface) OVERRIDE; |
62 virtual void SetVisible(bool visible) OVERRIDE; | 66 virtual void SetVisible(bool visible) OVERRIDE; |
63 virtual void setDeviceScaleFactor(float factor) OVERRIDE; | 67 virtual void setDeviceScaleFactor(float factor) OVERRIDE; |
64 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; | 68 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; |
65 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; | 69 virtual void SetHasTransparentBackground(bool flag) OVERRIDE; |
66 virtual void SetNeedsComposite() OVERRIDE; | 70 virtual void SetNeedsComposite() OVERRIDE; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 base::TimeTicks last_vsync_; | 183 base::TimeTicks last_vsync_; |
180 | 184 |
181 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 185 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
182 | 186 |
183 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 187 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
184 }; | 188 }; |
185 | 189 |
186 } // namespace content | 190 } // namespace content |
187 | 191 |
188 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 192 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |