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