| 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 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/threading/thread_restrictions.h" | 10 #include "base/threading/thread_restrictions.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 if (!offscreen) { | 117 if (!offscreen) { |
| 118 context->makeContextCurrent(); | 118 context->makeContextCurrent(); |
| 119 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); | 119 gfx::GLContext* gl_context = gfx::GLContext::GetCurrent(); |
| 120 bool vsync = !command_line->HasSwitch(switches::kDisableUIVsync); | 120 bool vsync = !command_line->HasSwitch(switches::kDisableUIVsync); |
| 121 gl_context->SetSwapInterval(vsync ? 1 : 0); | 121 gl_context->SetSwapInterval(vsync ? 1 : 0); |
| 122 gl_context->ReleaseCurrent(NULL); | 122 gl_context->ReleaseCurrent(NULL); |
| 123 } | 123 } |
| 124 return context; | 124 return context; |
| 125 } | 125 } |
| 126 | 126 |
| 127 Texture::Texture(bool flipped, const gfx::Size& size) | 127 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) |
| 128 : texture_id_(0), | 128 : texture_id_(0), |
| 129 flipped_(flipped), | 129 flipped_(flipped), |
| 130 size_(size) { | 130 size_(size), |
| 131 device_scale_factor_(device_scale_factor) { |
| 131 } | 132 } |
| 132 | 133 |
| 133 Texture::~Texture() { | 134 Texture::~Texture() { |
| 134 } | 135 } |
| 135 | 136 |
| 136 Compositor::Compositor(CompositorDelegate* delegate, | 137 Compositor::Compositor(CompositorDelegate* delegate, |
| 137 gfx::AcceleratedWidget widget) | 138 gfx::AcceleratedWidget widget) |
| 138 : delegate_(delegate), | 139 : delegate_(delegate), |
| 139 root_layer_(NULL), | 140 root_layer_(NULL), |
| 140 widget_(widget), | 141 widget_(widget), |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 | 432 |
| 432 COMPOSITOR_EXPORT void DisableTestCompositor() { | 433 COMPOSITOR_EXPORT void DisableTestCompositor() { |
| 433 test_compositor_enabled = false; | 434 test_compositor_enabled = false; |
| 434 } | 435 } |
| 435 | 436 |
| 436 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { | 437 COMPOSITOR_EXPORT bool IsTestCompositorEnabled() { |
| 437 return test_compositor_enabled; | 438 return test_compositor_enabled; |
| 438 } | 439 } |
| 439 | 440 |
| 440 } // namespace ui | 441 } // namespace ui |
| OLD | NEW |