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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 void ImageTransportHelper::SetSwapInterval(gfx::GLContext* context) { | 139 void ImageTransportHelper::SetSwapInterval(gfx::GLContext* context) { |
140 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
141 // If Aero Glass is enabled, then the renderer will handle ratelimiting and | 141 // If Aero Glass is enabled, then the renderer will handle ratelimiting and |
142 // there's no tearing, so waiting for vsync is unnecessary. | 142 // there's no tearing, so waiting for vsync is unnecessary. |
143 if (ui::win::IsAeroGlassEnabled()) { | 143 if (ui::win::IsAeroGlassEnabled()) { |
144 context->ForceSwapIntervalZero(true); | 144 context->ForceSwapIntervalZero(true); |
145 return; | 145 return; |
146 } | 146 } |
147 #endif | 147 #endif |
148 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableGpuVsync)) | 148 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 149 switches::kDisableGpuVsync)) |
149 context->ForceSwapIntervalZero(true); | 150 context->ForceSwapIntervalZero(true); |
150 else | 151 else |
151 context->SetSwapInterval(1); | 152 context->SetSwapInterval(1); |
152 } | 153 } |
153 | 154 |
154 gpu::gles2::GLES2Decoder* ImageTransportHelper::Decoder() { | 155 gpu::gles2::GLES2Decoder* ImageTransportHelper::Decoder() { |
155 if (!stub_.get()) | 156 if (!stub_.get()) |
156 return NULL; | 157 return NULL; |
157 return stub_->decoder(); | 158 return stub_->decoder(); |
158 } | 159 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { | 272 void PassThroughImageTransportSurface::SendVSyncUpdateIfAvailable() { |
272 gfx::VSyncProvider* vsync_provider = GetVSyncProvider(); | 273 gfx::VSyncProvider* vsync_provider = GetVSyncProvider(); |
273 if (vsync_provider) { | 274 if (vsync_provider) { |
274 vsync_provider->GetVSyncParameters( | 275 vsync_provider->GetVSyncParameters( |
275 base::Bind(&ImageTransportHelper::SendUpdateVSyncParameters, | 276 base::Bind(&ImageTransportHelper::SendUpdateVSyncParameters, |
276 helper_->AsWeakPtr())); | 277 helper_->AsWeakPtr())); |
277 } | 278 } |
278 } | 279 } |
279 | 280 |
280 } // namespace content | 281 } // namespace content |
OLD | NEW |