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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 public cc::LayerTreeHostClient, | 42 public cc::LayerTreeHostClient, |
43 public cc::LayerTreeHostSingleThreadClient, | 43 public cc::LayerTreeHostSingleThreadClient, |
44 public ImageTransportFactoryAndroidObserver, | 44 public ImageTransportFactoryAndroidObserver, |
45 public ui::WindowAndroidCompositor { | 45 public ui::WindowAndroidCompositor { |
46 public: | 46 public: |
47 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); | 47 CompositorImpl(CompositorClient* client, gfx::NativeWindow root_window); |
48 virtual ~CompositorImpl(); | 48 virtual ~CompositorImpl(); |
49 | 49 |
50 static bool IsInitialized(); | 50 static bool IsInitialized(); |
51 | 51 |
52 // Creates a surface texture and returns a surface texture id. Returns -1 on | |
53 // failure. | |
54 static int CreateSurfaceTexture(int child_process_id); | |
55 | |
56 // Destroy all surface textures associated with |child_process_id|. | |
57 static void DestroyAllSurfaceTextures(int child_process_id); | |
58 | |
59 void PopulateGpuCapabilities(gpu::Capabilities gpu_capabilities); | 52 void PopulateGpuCapabilities(gpu::Capabilities gpu_capabilities); |
60 | 53 |
61 private: | 54 private: |
62 // Compositor implementation. | 55 // Compositor implementation. |
63 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) override; | 56 virtual void SetRootLayer(scoped_refptr<cc::Layer> root) override; |
64 virtual void SetSurface(jobject surface) override; | 57 virtual void SetSurface(jobject surface) override; |
65 virtual void SetVisible(bool visible) override; | 58 virtual void SetVisible(bool visible) override; |
66 virtual void setDeviceScaleFactor(float factor) override; | 59 virtual void setDeviceScaleFactor(float factor) override; |
67 virtual void SetWindowBounds(const gfx::Size& size) override; | 60 virtual void SetWindowBounds(const gfx::Size& size) override; |
68 virtual void SetHasTransparentBackground(bool flag) override; | 61 virtual void SetHasTransparentBackground(bool flag) override; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 base::TimeTicks last_vsync_; | 184 base::TimeTicks last_vsync_; |
192 | 185 |
193 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 186 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
194 | 187 |
195 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 188 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
196 }; | 189 }; |
197 | 190 |
198 } // namespace content | 191 } // namespace content |
199 | 192 |
200 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 193 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |