| 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 #include "content/common/gpu/image_transport_surface.h" | 5 #include "content/common/gpu/image_transport_surface.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 void PassThroughImageTransportSurface::SetLatencyInfo( | 239 void PassThroughImageTransportSurface::SetLatencyInfo( |
| 240 const std::vector<ui::LatencyInfo>& latency_info) { | 240 const std::vector<ui::LatencyInfo>& latency_info) { |
| 241 for (size_t i = 0; i < latency_info.size(); i++) | 241 for (size_t i = 0; i < latency_info.size(); i++) |
| 242 latency_info_.push_back(latency_info[i]); | 242 latency_info_.push_back(latency_info[i]); |
| 243 } | 243 } |
| 244 | 244 |
| 245 bool PassThroughImageTransportSurface::SwapBuffers() { | 245 bool PassThroughImageTransportSurface::SwapBuffers() { |
| 246 // GetVsyncValues before SwapBuffers to work around Mali driver bug: | 246 // GetVsyncValues before SwapBuffers to work around Mali driver bug: |
| 247 // crbug.com/223558. | 247 // crbug.com/223558. |
| 248 SendVSyncUpdateIfAvailable(); | 248 SendVSyncUpdateIfAvailable(); |
| 249 for (size_t i = 0; i < latency_info_.size(); ++i) { |
| 250 latency_info_[i].AddLatencyNumber( |
| 251 ui::INPUT_EVENT_GPU_SWAP_BUFFER_COMPONENT, 0, 0); |
| 252 } |
| 249 bool result = gfx::GLSurfaceAdapter::SwapBuffers(); | 253 bool result = gfx::GLSurfaceAdapter::SwapBuffers(); |
| 250 for (size_t i = 0; i < latency_info_.size(); i++) { | 254 for (size_t i = 0; i < latency_info_.size(); i++) { |
| 251 latency_info_[i].AddLatencyNumber( | 255 latency_info_[i].AddLatencyNumber( |
| 252 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); | 256 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0); |
| 253 } | 257 } |
| 254 | 258 |
| 255 helper_->SendLatencyInfo(latency_info_); | 259 helper_->SendLatencyInfo(latency_info_); |
| 256 latency_info_.clear(); | 260 latency_info_.clear(); |
| 257 return result; | 261 return result; |
| 258 } | 262 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { | 306 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { |
| 303 gfx::VSyncProvider* vsync_provider = GetVSyncProvider(); | 307 gfx::VSyncProvider* vsync_provider = GetVSyncProvider(); |
| 304 if (vsync_provider) { | 308 if (vsync_provider) { |
| 305 vsync_provider->GetVSyncParameters( | 309 vsync_provider->GetVSyncParameters( |
| 306 base::Bind(&ImageTransportHelper::SendUpdateVSyncParameters, | 310 base::Bind(&ImageTransportHelper::SendUpdateVSyncParameters, |
| 307 helper_->AsWeakPtr())); | 311 helper_->AsWeakPtr())); |
| 308 } | 312 } |
| 309 } | 313 } |
| 310 | 314 |
| 311 } // namespace content | 315 } // namespace content |
| OLD | NEW |