| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 context->makeContextCurrent(); | 184 context->makeContextCurrent(); |
| 185 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); | 185 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); |
| 186 bool vsync = !command_line->HasSwitch(switches::kDisableGpuVsync); | 186 bool vsync = !command_line->HasSwitch(switches::kDisableGpuVsync); |
| 187 gl_context->SetSwapInterval(vsync ? 1 : 0); | 187 gl_context->SetSwapInterval(vsync ? 1 : 0); |
| 188 gl_context->ReleaseCurrent(NULL); | 188 gl_context->ReleaseCurrent(NULL); |
| 189 } | 189 } |
| 190 return context; | 190 return context; |
| 191 } | 191 } |
| 192 | 192 |
| 193 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) | 193 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) |
| 194 : flipped_(flipped), | 194 : size_(size), |
| 195 size_(size), | 195 flipped_(flipped), |
| 196 device_scale_factor_(device_scale_factor) { | 196 device_scale_factor_(device_scale_factor) { |
| 197 } | 197 } |
| 198 | 198 |
| 199 Texture::~Texture() { | 199 Texture::~Texture() { |
| 200 } | 200 } |
| 201 | 201 |
| 202 CompositorLock::CompositorLock(Compositor* compositor) | 202 CompositorLock::CompositorLock(Compositor* compositor) |
| 203 : compositor_(compositor) { | 203 : compositor_(compositor) { |
| 204 MessageLoop::current()->PostDelayedTask( | 204 MessageLoop::current()->PostDelayedTask( |
| 205 FROM_HERE, | 205 FROM_HERE, |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 | 592 |
| 593 COMPOSITOR_EXPORT void DisableTestCompositor() { | 593 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 594 test_compositor_enabled = false; | 594 test_compositor_enabled = false; |
| 595 } | 595 } |
| 596 | 596 |
| 597 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 597 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
| 598 return test_compositor_enabled; | 598 return test_compositor_enabled; |
| 599 } | 599 } |
| 600 | 600 |
| 601 } // namespace ui | 601 } // namespace ui |
| OLD | NEW |