| 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 #ifndef UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_ | 5 #ifndef UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_ |
| 6 #define UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_ | 6 #define UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "ui/gfx/compositor/compositor.h" | 12 #include "ui/gfx/compositor/compositor.h" |
| 13 | 13 |
| 14 namespace ui { | 14 namespace ui { |
| 15 | 15 |
| 16 class TestCompositorDelegate; | 16 class TestCompositorDelegate; |
| 17 | 17 |
| 18 // Trivial Compositor implementation that creates Textures of type TestTexture. | 18 // Trivial Compositor implementation that creates Textures of type TestTexture. |
| 19 class TestCompositor : public ui::Compositor { | 19 class TestCompositor : public ui::Compositor { |
| 20 public: | 20 public: |
| 21 explicit TestCompositor(CompositorDelegate* owner); | 21 explicit TestCompositor(CompositorDelegate* owner); |
| 22 virtual ~TestCompositor(); | 22 virtual ~TestCompositor(); |
| 23 | 23 |
| 24 // ui::Compositor: | 24 // ui::Compositor: |
| 25 virtual ui::Texture* CreateTexture() OVERRIDE; | 25 virtual ui::Texture* CreateTexture() OVERRIDE; |
| 26 virtual void OnNotifyStart(bool clear) OVERRIDE; | 26 virtual void OnNotifyStart(bool clear) OVERRIDE; |
| 27 virtual void OnNotifyEnd() OVERRIDE; | 27 virtual void OnNotifyEnd() OVERRIDE; |
| 28 virtual void Blur(const gfx::Rect& bounds) OVERRIDE; | 28 virtual void Blur(const gfx::Rect& bounds) OVERRIDE; |
| 29 virtual void DrawTree() OVERRIDE; | 29 virtual void DrawTree() OVERRIDE; |
| 30 virtual bool ReadPixels(SkBitmap* bitmap) OVERRIDE; | 30 virtual bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds) OVERRIDE; |
| 31 | 31 |
| 32 // A simple factory that creates a test compositor with a given delegate | 32 // A simple factory that creates a test compositor with a given delegate |
| 33 static ui::Compositor* Create(ui::CompositorDelegate* owner); | 33 static ui::Compositor* Create(ui::CompositorDelegate* owner); |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 virtual void OnWidgetSizeChanged() OVERRIDE; | 36 virtual void OnWidgetSizeChanged() OVERRIDE; |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 scoped_ptr<TestCompositorDelegate> owned_delegate_; | 39 scoped_ptr<TestCompositorDelegate> owned_delegate_; |
| 40 | 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(TestCompositor); | 41 DISALLOW_COPY_AND_ASSIGN(TestCompositor); |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 } // namespace ui | 44 } // namespace ui |
| 45 | 45 |
| 46 #endif // UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_ | 46 #endif // UI_GFX_COMPOSITOR_TEST_COMPOSITOR_H_ |
| OLD | NEW |