OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "chrome/browser/renderer_host/accelerated_surface_container_touch.h" | 9 #include "chrome/browser/renderer_host/accelerated_surface_container_touch.h" |
10 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 10 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 return status; | 190 return status; |
191 } | 191 } |
192 | 192 |
193 gfx::PluginWindowHandle RenderWidgetHostViewViews::GetCompositingSurface() { | 193 gfx::PluginWindowHandle RenderWidgetHostViewViews::GetCompositingSurface() { |
194 // On TOUCH_UI builds, the GPU process renders to an offscreen surface | 194 // On TOUCH_UI builds, the GPU process renders to an offscreen surface |
195 // (created by the GPU process), which is later displayed by the browser. | 195 // (created by the GPU process), which is later displayed by the browser. |
196 // As the GPU process creates this surface, we can return any non-zero value. | 196 // As the GPU process creates this surface, we can return any non-zero value. |
197 return 1; | 197 return 1; |
198 } | 198 } |
199 | 199 |
200 void RenderWidgetHostViewViews::AcceleratedSurfaceSetIOSurface( | 200 void RenderWidgetHostViewViews::AcceleratedSurfaceNew( |
201 int32 width, int32 height, uint64 surface_id) { | 201 int32 width, |
202 accelerated_surface_containers_[surface_id] = | 202 int32 height, |
203 AcceleratedSurfaceContainerTouch::CreateAcceleratedSurfaceContainer( | 203 uint64* surface_id, |
204 gfx::Size(width, height), | 204 TransportDIB::Handle* surface_handle) { |
205 surface_id); | 205 AcceleratedSurfaceContainerTouch* surface = |
sky
2011/09/21 21:39:55
Use a scoped_ptr or scoped_refptr.
| |
206 AcceleratedSurfaceContainerTouch::CreateAcceleratedSurfaceContainer( | |
207 gfx::Size(width, height)); | |
208 if (!surface->Initialize(surface_id)) { | |
209 LOG(ERROR) << "Failed to create AcceleratedSurfaceContainer"; | |
210 delete surface; | |
211 return; | |
212 } | |
213 *surface_handle = surface->handle(); | |
214 | |
215 accelerated_surface_containers_[*surface_id] = surface; | |
206 } | 216 } |
207 | 217 |
208 void RenderWidgetHostViewViews::AcceleratedSurfaceRelease(uint64 surface_id) { | 218 void RenderWidgetHostViewViews::AcceleratedSurfaceRelease(uint64 surface_id) { |
209 accelerated_surface_containers_.erase(surface_id); | 219 accelerated_surface_containers_.erase(surface_id); |
210 } | 220 } |
211 | 221 |
212 void RenderWidgetHostViewViews::AcceleratedSurfaceBuffersSwapped( | 222 void RenderWidgetHostViewViews::AcceleratedSurfaceBuffersSwapped( |
213 uint64 surface_id, | 223 uint64 surface_id, |
214 int32 route_id, | 224 int32 route_id, |
215 int gpu_host_id) { | 225 int gpu_host_id) { |
(...skipping 16 matching lines...) Expand all Loading... | |
232 void RenderWidgetHostViewViews::OnCompositingEnded(ui::Compositor* compositor) { | 242 void RenderWidgetHostViewViews::OnCompositingEnded(ui::Compositor* compositor) { |
233 for (std::vector< base::Callback<void(void)> >::const_iterator | 243 for (std::vector< base::Callback<void(void)> >::const_iterator |
234 it = on_compositing_ended_callbacks_.begin(); | 244 it = on_compositing_ended_callbacks_.begin(); |
235 it != on_compositing_ended_callbacks_.end(); ++it) { | 245 it != on_compositing_ended_callbacks_.end(); ++it) { |
236 it->Run(); | 246 it->Run(); |
237 } | 247 } |
238 on_compositing_ended_callbacks_.clear(); | 248 on_compositing_ended_callbacks_.clear(); |
239 compositor->RemoveObserver(this); | 249 compositor->RemoveObserver(this); |
240 } | 250 } |
241 | 251 |
OLD | NEW |