| 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/renderer_host/accelerated_surface_container_touch.h" | 8 #include "chrome/browser/renderer_host/accelerated_surface_container_touch.h" |
| 9 #include "content/browser/renderer_host/render_widget_host.h" | 9 #include "content/browser/renderer_host/render_widget_host.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFact
ory.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFact
ory.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // On TOUCH_UI builds, the GPU process renders to an offscreen surface | 184 // On TOUCH_UI builds, the GPU process renders to an offscreen surface |
| 185 // (created by the GPU process), which is later displayed by the browser. | 185 // (created by the GPU process), which is later displayed by the browser. |
| 186 // As the GPU process creates this surface, we can return any non-zero value. | 186 // As the GPU process creates this surface, we can return any non-zero value. |
| 187 return 1; | 187 return 1; |
| 188 } | 188 } |
| 189 | 189 |
| 190 void RenderWidgetHostViewViews::AcceleratedSurfaceSetIOSurface( | 190 void RenderWidgetHostViewViews::AcceleratedSurfaceSetIOSurface( |
| 191 int32 width, int32 height, uint64 surface_id) { | 191 int32 width, int32 height, uint64 surface_id) { |
| 192 accelerated_surface_containers_[surface_id] = | 192 accelerated_surface_containers_[surface_id] = |
| 193 AcceleratedSurfaceContainerTouch::CreateAcceleratedSurfaceContainer( | 193 AcceleratedSurfaceContainerTouch::CreateAcceleratedSurfaceContainer( |
| 194 static_cast<ui::CompositorGL*>(GetWidget()->GetCompositor()), | |
| 195 gfx::Size(width, height), | 194 gfx::Size(width, height), |
| 196 surface_id); | 195 surface_id); |
| 197 } | 196 } |
| 198 | 197 |
| 199 void RenderWidgetHostViewViews::AcceleratedSurfaceRelease(uint64 surface_id) { | 198 void RenderWidgetHostViewViews::AcceleratedSurfaceRelease(uint64 surface_id) { |
| 200 accelerated_surface_containers_.erase(surface_id); | 199 accelerated_surface_containers_.erase(surface_id); |
| 201 } | 200 } |
| 202 | 201 |
| 203 void RenderWidgetHostViewViews::AcceleratedSurfaceBuffersSwapped( | 202 void RenderWidgetHostViewViews::AcceleratedSurfaceBuffersSwapped( |
| 204 uint64 surface_id) { | 203 uint64 surface_id) { |
| 205 SetExternalTexture(accelerated_surface_containers_[surface_id].get()); | 204 SetExternalTexture(accelerated_surface_containers_[surface_id].get()); |
| 206 glFlush(); | 205 glFlush(); |
| 207 } | 206 } |
| OLD | NEW |