| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/compositor/test_compositor.h" | 5 #include "ui/gfx/compositor/test_compositor.h" |
| 6 | 6 |
| 7 #include "ui/gfx/compositor/test_texture.h" | 7 #include "ui/gfx/compositor/test_texture.h" |
| 8 | 8 |
| 9 namespace ui { | 9 namespace ui { |
| 10 | 10 |
| 11 class TestCompositorDelegate : public ui::CompositorDelegate { | 11 class TestCompositorDelegate : public ui::CompositorDelegate { |
| 12 public: | 12 public: |
| 13 TestCompositorDelegate() {} | 13 TestCompositorDelegate() {} |
| 14 virtual ~TestCompositorDelegate() {} | 14 virtual ~TestCompositorDelegate() {} |
| 15 | 15 |
| 16 virtual void ScheduleDraw() OVERRIDE {} | 16 virtual void ScheduleDraw() OVERRIDE {} |
| 17 | 17 |
| 18 private: | 18 private: |
| 19 DISALLOW_COPY_AND_ASSIGN(TestCompositorDelegate); | 19 DISALLOW_COPY_AND_ASSIGN(TestCompositorDelegate); |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 TestCompositor::TestCompositor() | 22 TestCompositor::TestCompositor(CompositorDelegate *owner) |
| 23 : Compositor(new TestCompositorDelegate, gfx::Size(100, 100)) { | 23 : Compositor((owner ? owner : new TestCompositorDelegate), |
| 24 owned_delegate_.reset(static_cast<TestCompositorDelegate*>(delegate())); | 24 gfx::Size(100, 100)) { |
| 25 if (!owner) |
| 26 owned_delegate_.reset(static_cast<TestCompositorDelegate*>(delegate())); |
| 25 } | 27 } |
| 26 | 28 |
| 27 TestCompositor::~TestCompositor() { | 29 TestCompositor::~TestCompositor() { |
| 28 } | 30 } |
| 29 | 31 |
| 30 ui::Texture* TestCompositor::CreateTexture() { | 32 ui::Texture* TestCompositor::CreateTexture() { |
| 31 return new TestTexture(); | 33 return new TestTexture(); |
| 32 } | 34 } |
| 33 | 35 |
| 34 void TestCompositor::OnNotifyStart(bool clear) { | 36 void TestCompositor::OnNotifyStart(bool clear) { |
| 35 } | 37 } |
| 36 | 38 |
| 37 void TestCompositor::OnNotifyEnd() { | 39 void TestCompositor::OnNotifyEnd() { |
| 38 } | 40 } |
| 39 | 41 |
| 40 void TestCompositor::Blur(const gfx::Rect& bounds) { | 42 void TestCompositor::Blur(const gfx::Rect& bounds) { |
| 41 } | 43 } |
| 42 | 44 |
| 43 void TestCompositor::OnWidgetSizeChanged() { | 45 void TestCompositor::OnWidgetSizeChanged() { |
| 44 } | 46 } |
| 45 | 47 |
| 46 } // namespace ui | 48 } // namespace ui |
| OLD | NEW |