| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 namespace {} // namespace | 68 namespace {} // namespace |
| 69 | 69 |
| 70 namespace ui { | 70 namespace ui { |
| 71 | 71 |
| 72 class SatisfySwapPromise : public cc::SwapPromise { | 72 class SatisfySwapPromise : public cc::SwapPromise { |
| 73 public: | 73 public: |
| 74 explicit SatisfySwapPromise(uint32_t id) : id_(id) {} | 74 explicit SatisfySwapPromise(uint32_t id) : id_(id) {} |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 virtual void DidSwap(cc::CompositorFrameMetadata* metadata) OVERRIDE { | 77 virtual void DidSwap(cc::CompositorFrameMetadata* metadata) override { |
| 78 metadata->satisfies_sequences.push_back(id_); | 78 metadata->satisfies_sequences.push_back(id_); |
| 79 } | 79 } |
| 80 | 80 |
| 81 virtual void DidNotSwap(DidNotSwapReason reason) OVERRIDE { | 81 virtual void DidNotSwap(DidNotSwapReason reason) override { |
| 82 // TODO(jbauman): Send to the SurfaceManager immediately. | 82 // TODO(jbauman): Send to the SurfaceManager immediately. |
| 83 DCHECK(false); | 83 DCHECK(false); |
| 84 } | 84 } |
| 85 virtual int64 TraceId() const OVERRIDE { return 0; } | 85 virtual int64 TraceId() const override { return 0; } |
| 86 uint32_t id_; | 86 uint32_t id_; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 Compositor::Compositor(gfx::AcceleratedWidget widget, | 89 Compositor::Compositor(gfx::AcceleratedWidget widget, |
| 90 ui::ContextFactory* context_factory, | 90 ui::ContextFactory* context_factory, |
| 91 scoped_refptr<base::SingleThreadTaskRunner> task_runner) | 91 scoped_refptr<base::SingleThreadTaskRunner> task_runner) |
| 92 : context_factory_(context_factory), | 92 : context_factory_(context_factory), |
| 93 root_layer_(NULL), | 93 root_layer_(NULL), |
| 94 widget_(widget), | 94 widget_(widget), |
| 95 surface_id_allocator_(context_factory->CreateSurfaceIdAllocator()), | 95 surface_id_allocator_(context_factory->CreateSurfaceIdAllocator()), |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 // Call ScheduleDraw() instead of Draw() in order to allow other | 473 // Call ScheduleDraw() instead of Draw() in order to allow other |
| 474 // CompositorObservers to be notified before starting another | 474 // CompositorObservers to be notified before starting another |
| 475 // draw cycle. | 475 // draw cycle. |
| 476 ScheduleDraw(); | 476 ScheduleDraw(); |
| 477 } | 477 } |
| 478 FOR_EACH_OBSERVER( | 478 FOR_EACH_OBSERVER( |
| 479 CompositorObserver, observer_list_, OnCompositingEnded(this)); | 479 CompositorObserver, observer_list_, OnCompositingEnded(this)); |
| 480 } | 480 } |
| 481 | 481 |
| 482 } // namespace ui | 482 } // namespace ui |
| OLD | NEW |