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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "content/common/gpu/image_transport_surface.h" | 7 #include "content/common/gpu/image_transport_surface.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 void PbufferImageTransportSurface::SendBuffersSwapped() { | 192 void PbufferImageTransportSurface::SendBuffersSwapped() { |
193 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; | 193 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params; |
194 params.surface_handle = reinterpret_cast<int64>(GetShareHandle()); | 194 params.surface_handle = reinterpret_cast<int64>(GetShareHandle()); |
195 CHECK(params.surface_handle); | 195 CHECK(params.surface_handle); |
196 | 196 |
197 params.size = GetSize(); | 197 params.size = GetSize(); |
198 helper_->SendAcceleratedSurfaceBuffersSwapped(params); | 198 helper_->SendAcceleratedSurfaceBuffersSwapped(params); |
199 | 199 |
200 DCHECK(!is_swap_buffers_pending_); | 200 DCHECK(!is_swap_buffers_pending_); |
201 is_swap_buffers_pending_ = true; | 201 is_swap_buffers_pending_ = true; |
202 | |
203 // Pause all processing of this command buffer. | |
204 // http://code.google.com/p/chromium/issues/detail?id=135546 | |
205 DeferDraws(); | |
206 } | 202 } |
207 | 203 |
208 void PbufferImageTransportSurface::OnBufferPresented(uint32 sync_point) { | 204 void PbufferImageTransportSurface::OnBufferPresented(uint32 sync_point) { |
209 is_swap_buffers_pending_ = false; | 205 is_swap_buffers_pending_ = false; |
210 if (did_unschedule_) { | 206 if (did_unschedule_) { |
211 did_unschedule_ = false; | 207 did_unschedule_ = false; |
212 helper_->SetScheduled(true); | 208 helper_->SetScheduled(true); |
213 } | 209 } |
214 } | 210 } |
215 | 211 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 handle.transport); | 259 handle.transport); |
264 } | 260 } |
265 | 261 |
266 if (surface->Initialize()) | 262 if (surface->Initialize()) |
267 return surface; | 263 return surface; |
268 else | 264 else |
269 return NULL; | 265 return NULL; |
270 } | 266 } |
271 | 267 |
272 #endif // ENABLE_GPU | 268 #endif // ENABLE_GPU |
OLD | NEW |