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 "ui/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 context->makeContextCurrent(); | 185 context->makeContextCurrent(); |
186 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); | 186 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); |
187 bool vsync = !command_line->HasSwitch(switches::kDisableGpuVsync); | 187 bool vsync = !command_line->HasSwitch(switches::kDisableGpuVsync); |
188 gl_context->SetSwapInterval(vsync ? 1 : 0); | 188 gl_context->SetSwapInterval(vsync ? 1 : 0); |
189 gl_context->ReleaseCurrent(NULL); | 189 gl_context->ReleaseCurrent(NULL); |
190 } | 190 } |
191 return context; | 191 return context; |
192 } | 192 } |
193 | 193 |
194 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) | 194 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) |
195 : size_(size), | 195 : flipped_(flipped), |
196 flipped_(flipped), | 196 size_(size), |
197 device_scale_factor_(device_scale_factor) { | 197 device_scale_factor_(device_scale_factor) { |
198 } | 198 } |
199 | 199 |
200 Texture::~Texture() { | 200 Texture::~Texture() { |
201 } | 201 } |
202 | 202 |
203 CompositorLock::CompositorLock(Compositor* compositor) | 203 CompositorLock::CompositorLock(Compositor* compositor) |
204 : compositor_(compositor) { | 204 : compositor_(compositor) { |
205 MessageLoop::current()->PostDelayedTask( | 205 MessageLoop::current()->PostDelayedTask( |
206 FROM_HERE, | 206 FROM_HERE, |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 | 597 |
598 COMPOSITOR_EXPORT void DisableTestCompositor() { | 598 COMPOSITOR_EXPORT void DisableTestCompositor() { |
599 test_compositor_enabled = false; | 599 test_compositor_enabled = false; |
600 } | 600 } |
601 | 601 |
602 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 602 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
603 return test_compositor_enabled; | 603 return test_compositor_enabled; |
604 } | 604 } |
605 | 605 |
606 } // namespace ui | 606 } // namespace ui |
OLD | NEW |