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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 virtual void SetSurface(jobject surface) OVERRIDE; | 54 virtual void SetSurface(jobject surface) OVERRIDE; |
55 virtual void SetVisible(bool visible) OVERRIDE; | 55 virtual void SetVisible(bool visible) OVERRIDE; |
56 virtual void setDeviceScaleFactor(float factor) OVERRIDE; | 56 virtual void setDeviceScaleFactor(float factor) OVERRIDE; |
57 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; | 57 virtual void SetWindowBounds(const gfx::Size& size) OVERRIDE; |
58 virtual bool CompositeAndReadback( | 58 virtual bool CompositeAndReadback( |
59 void *pixels, const gfx::Rect& rect) OVERRIDE; | 59 void *pixels, const gfx::Rect& rect) OVERRIDE; |
60 virtual void Composite() OVERRIDE; | 60 virtual void Composite() OVERRIDE; |
61 virtual cc::UIResourceId GenerateUIResource( | 61 virtual cc::UIResourceId GenerateUIResource( |
62 const cc::UIResourceBitmap& bitmap) OVERRIDE; | 62 const cc::UIResourceBitmap& bitmap) OVERRIDE; |
63 virtual void DeleteUIResource(cc::UIResourceId resource_id) OVERRIDE; | 63 virtual void DeleteUIResource(cc::UIResourceId resource_id) OVERRIDE; |
64 virtual WebKit::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE; | 64 virtual blink::WebGLId GenerateTexture(gfx::JavaBitmap& bitmap) OVERRIDE; |
65 virtual WebKit::WebGLId GenerateCompressedTexture( | 65 virtual blink::WebGLId GenerateCompressedTexture( |
66 gfx::Size& size, int data_size, void* data) OVERRIDE; | 66 gfx::Size& size, int data_size, void* data) OVERRIDE; |
67 virtual void DeleteTexture(WebKit::WebGLId texture_id) OVERRIDE; | 67 virtual void DeleteTexture(blink::WebGLId texture_id) OVERRIDE; |
68 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, | 68 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, |
69 gfx::JavaBitmap& bitmap) OVERRIDE; | 69 gfx::JavaBitmap& bitmap) OVERRIDE; |
70 virtual bool CopyTextureToBitmap(WebKit::WebGLId texture_id, | 70 virtual bool CopyTextureToBitmap(blink::WebGLId texture_id, |
71 const gfx::Rect& sub_rect, | 71 const gfx::Rect& sub_rect, |
72 gfx::JavaBitmap& bitmap) OVERRIDE; | 72 gfx::JavaBitmap& bitmap) OVERRIDE; |
73 | 73 |
74 // LayerTreeHostClient implementation. | 74 // LayerTreeHostClient implementation. |
75 virtual void WillBeginMainFrame() OVERRIDE {} | 75 virtual void WillBeginMainFrame() OVERRIDE {} |
76 virtual void DidBeginMainFrame() OVERRIDE {} | 76 virtual void DidBeginMainFrame() OVERRIDE {} |
77 virtual void Animate(double frame_begin_time) OVERRIDE {} | 77 virtual void Animate(double frame_begin_time) OVERRIDE {} |
78 virtual void Layout() OVERRIDE {} | 78 virtual void Layout() OVERRIDE {} |
79 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, | 79 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, |
80 float page_scale) OVERRIDE {} | 80 float page_scale) OVERRIDE {} |
(...skipping 10 matching lines...) Expand all Loading... |
91 | 91 |
92 // WebGraphicsContext3DSwapBuffersClient implementation. | 92 // WebGraphicsContext3DSwapBuffersClient implementation. |
93 virtual void OnViewContextSwapBuffersPosted() OVERRIDE; | 93 virtual void OnViewContextSwapBuffersPosted() OVERRIDE; |
94 virtual void OnViewContextSwapBuffersComplete() OVERRIDE; | 94 virtual void OnViewContextSwapBuffersComplete() OVERRIDE; |
95 virtual void OnViewContextSwapBuffersAborted() OVERRIDE; | 95 virtual void OnViewContextSwapBuffersAborted() OVERRIDE; |
96 | 96 |
97 // ImageTransportFactoryAndroidObserver implementation. | 97 // ImageTransportFactoryAndroidObserver implementation. |
98 virtual void OnLostResources() OVERRIDE; | 98 virtual void OnLostResources() OVERRIDE; |
99 | 99 |
100 private: | 100 private: |
101 WebKit::WebGLId BuildBasicTexture(); | 101 blink::WebGLId BuildBasicTexture(); |
102 WebKit::WGC3Denum GetGLFormatForBitmap(gfx::JavaBitmap& bitmap); | 102 blink::WGC3Denum GetGLFormatForBitmap(gfx::JavaBitmap& bitmap); |
103 WebKit::WGC3Denum GetGLTypeForBitmap(gfx::JavaBitmap& bitmap); | 103 blink::WGC3Denum GetGLTypeForBitmap(gfx::JavaBitmap& bitmap); |
104 | 104 |
105 scoped_refptr<cc::Layer> root_layer_; | 105 scoped_refptr<cc::Layer> root_layer_; |
106 scoped_ptr<cc::LayerTreeHost> host_; | 106 scoped_ptr<cc::LayerTreeHost> host_; |
107 | 107 |
108 gfx::Size size_; | 108 gfx::Size size_; |
109 bool has_transparent_background_; | 109 bool has_transparent_background_; |
110 | 110 |
111 ANativeWindow* window_; | 111 ANativeWindow* window_; |
112 int surface_id_; | 112 int surface_id_; |
113 | 113 |
114 CompositorClient* client_; | 114 CompositorClient* client_; |
115 base::WeakPtrFactory<CompositorImpl> weak_factory_; | 115 base::WeakPtrFactory<CompositorImpl> weak_factory_; |
116 | 116 |
117 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; | 117 scoped_refptr<cc::ContextProvider> null_offscreen_context_provider_; |
118 | 118 |
119 typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::ScopedUIResource> | 119 typedef base::ScopedPtrHashMap<cc::UIResourceId, cc::ScopedUIResource> |
120 UIResourceMap; | 120 UIResourceMap; |
121 UIResourceMap ui_resource_map_; | 121 UIResourceMap ui_resource_map_; |
122 | 122 |
123 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); | 123 DISALLOW_COPY_AND_ASSIGN(CompositorImpl); |
124 }; | 124 }; |
125 | 125 |
126 } // namespace content | 126 } // namespace content |
127 | 127 |
128 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ | 128 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_IMPL_ANDROID_H_ |
OLD | NEW |