Chromium Code Reviews| 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 = |
| 206 AcceleratedSurfaceContainerTouch::CreateAcceleratedSurfaceContainer( | |
| 207 gfx::Size(width, height)); | |
| 208 surface->Initialize(surface_id); | |
|
jonathan.backer
2011/09/21 20:27:36
Do you want to do anything with the return value?
danakj
2011/09/21 20:58:20
I don't know, only the GLX one can fail. In the p
danakj
2011/09/21 21:15:37
It is back practice to ignore return errors, so if
| |
| 209 *surface_handle = surface->handle(); | |
| 210 | |
| 211 accelerated_surface_containers_[*surface_id] = surface; | |
| 206 } | 212 } |
| 207 | 213 |
| 208 void RenderWidgetHostViewViews::AcceleratedSurfaceRelease(uint64 surface_id) { | 214 void RenderWidgetHostViewViews::AcceleratedSurfaceRelease(uint64 surface_id) { |
| 209 accelerated_surface_containers_.erase(surface_id); | 215 accelerated_surface_containers_.erase(surface_id); |
| 210 } | 216 } |
| 211 | 217 |
| 212 void RenderWidgetHostViewViews::AcceleratedSurfaceBuffersSwapped( | 218 void RenderWidgetHostViewViews::AcceleratedSurfaceBuffersSwapped( |
| 213 uint64 surface_id, | 219 uint64 surface_id, |
| 214 int32 route_id, | 220 int32 route_id, |
| 215 int gpu_host_id) { | 221 int gpu_host_id) { |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 232 void RenderWidgetHostViewViews::OnCompositingEnded(ui::Compositor* compositor) { | 238 void RenderWidgetHostViewViews::OnCompositingEnded(ui::Compositor* compositor) { |
| 233 for (std::vector< base::Callback<void(void)> >::const_iterator | 239 for (std::vector< base::Callback<void(void)> >::const_iterator |
| 234 it = on_compositing_ended_callbacks_.begin(); | 240 it = on_compositing_ended_callbacks_.begin(); |
| 235 it != on_compositing_ended_callbacks_.end(); ++it) { | 241 it != on_compositing_ended_callbacks_.end(); ++it) { |
| 236 it->Run(); | 242 it->Run(); |
| 237 } | 243 } |
| 238 on_compositing_ended_callbacks_.clear(); | 244 on_compositing_ended_callbacks_.clear(); |
| 239 compositor->RemoveObserver(this); | 245 compositor->RemoveObserver(this); |
| 240 } | 246 } |
| 241 | 247 |
| OLD | NEW |