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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 context->makeContextCurrent(); | 189 context->makeContextCurrent(); |
190 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); | 190 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); |
191 bool vsync = !command_line->HasSwitch(switches::kDisableGpuVsync); | 191 bool vsync = !command_line->HasSwitch(switches::kDisableGpuVsync); |
192 gl_context->SetSwapInterval(vsync ? 1 : 0); | 192 gl_context->SetSwapInterval(vsync ? 1 : 0); |
193 gl_context->ReleaseCurrent(NULL); | 193 gl_context->ReleaseCurrent(NULL); |
194 } | 194 } |
195 return context; | 195 return context; |
196 } | 196 } |
197 | 197 |
198 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) | 198 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) |
199 : flipped_(flipped), | 199 : size_(size), |
200 size_(size), | 200 flipped_(flipped), |
201 device_scale_factor_(device_scale_factor) { | 201 device_scale_factor_(device_scale_factor) { |
202 } | 202 } |
203 | 203 |
204 Texture::~Texture() { | 204 Texture::~Texture() { |
205 } | 205 } |
206 | 206 |
207 CompositorLock::CompositorLock(Compositor* compositor) | 207 CompositorLock::CompositorLock(Compositor* compositor) |
208 : compositor_(compositor) { | 208 : compositor_(compositor) { |
209 MessageLoop::current()->PostDelayedTask( | 209 MessageLoop::current()->PostDelayedTask( |
210 FROM_HERE, | 210 FROM_HERE, |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 | 600 |
601 COMPOSITOR_EXPORT void DisableTestCompositor() { | 601 COMPOSITOR_EXPORT void DisableTestCompositor() { |
602 test_compositor_enabled = false; | 602 test_compositor_enabled = false; |
603 } | 603 } |
604 | 604 |
605 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 605 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
606 return test_compositor_enabled; | 606 return test_compositor_enabled; |
607 } | 607 } |
608 | 608 |
609 } // namespace ui | 609 } // namespace ui |
OLD | NEW |