| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 namespace ui { | 73 namespace ui { |
| 74 | 74 |
| 75 // static | 75 // static |
| 76 ContextFactory* ContextFactory::GetInstance() { | 76 ContextFactory* ContextFactory::GetInstance() { |
| 77 DCHECK(g_context_factory); | 77 DCHECK(g_context_factory); |
| 78 return g_context_factory; | 78 return g_context_factory; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // static | 81 // static |
| 82 void ContextFactory::SetInstance(ContextFactory* instance) { | 82 void ContextFactory::SetInstance(ContextFactory* instance) { |
| 83 DCHECK_NE(!!g_context_factory, !!instance); |
| 83 g_context_factory = instance; | 84 g_context_factory = instance; |
| 84 } | 85 } |
| 85 | 86 |
| 86 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) | 87 Texture::Texture(bool flipped, const gfx::Size& size, float device_scale_factor) |
| 87 : size_(size), | 88 : size_(size), |
| 88 flipped_(flipped), | 89 flipped_(flipped), |
| 89 device_scale_factor_(device_scale_factor) { | 90 device_scale_factor_(device_scale_factor) { |
| 90 } | 91 } |
| 91 | 92 |
| 92 Texture::~Texture() { | 93 Texture::~Texture() { |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 // CompositorObservers to be notified before starting another | 574 // CompositorObservers to be notified before starting another |
| 574 // draw cycle. | 575 // draw cycle. |
| 575 ScheduleDraw(); | 576 ScheduleDraw(); |
| 576 } | 577 } |
| 577 FOR_EACH_OBSERVER(CompositorObserver, | 578 FOR_EACH_OBSERVER(CompositorObserver, |
| 578 observer_list_, | 579 observer_list_, |
| 579 OnCompositingEnded(this)); | 580 OnCompositingEnded(this)); |
| 580 } | 581 } |
| 581 | 582 |
| 582 } // namespace ui | 583 } // namespace ui |
| OLD | NEW |