Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1234)

Side by Side Diff: ui/gfx/compositor/test/test_compositor.cc

Issue 8805033: Makes tests either use mock compositor or mock WebGraphicsContext3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #include "ui/gfx/compositor/test/test_compositor.h"
6
7 #include "ui/gfx/compositor/test/test_texture.h"
8
9 namespace ui {
10
11 class TestCompositorDelegate : public ui::CompositorDelegate {
12 public:
13 TestCompositorDelegate() {}
14 virtual ~TestCompositorDelegate() {}
15
16 virtual void ScheduleDraw() OVERRIDE {}
17
18 private:
19 DISALLOW_COPY_AND_ASSIGN(TestCompositorDelegate);
20 };
21
22 TestCompositor::TestCompositor(CompositorDelegate *owner)
23 : Compositor((owner ? owner : new TestCompositorDelegate),
24 gfx::Size(100, 100)) {
25 if (!owner)
26 owned_delegate_.reset(static_cast<TestCompositorDelegate*>(delegate()));
27 }
28
29 TestCompositor::~TestCompositor() {
30 }
31
32 ui::Texture* TestCompositor::CreateTexture() {
33 return new TestTexture();
34 }
35
36 void TestCompositor::OnNotifyStart(bool clear) {
37 }
38
39 void TestCompositor::OnNotifyEnd() {
40 }
41
42 void TestCompositor::Blur(const gfx::Rect& bounds) {
43 }
44
45 void TestCompositor::DrawTree() {
46 #if !defined(USE_WEBKIT_COMPOSITOR)
47 Compositor::DrawTree();
48 #endif
49 }
50
51 bool TestCompositor::ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds) {
52 return false;
53 }
54
55 ui::Compositor* TestCompositor::Create(ui::CompositorDelegate* owner) {
56 return new ui::TestCompositor(owner);
57 }
58
59 void TestCompositor::OnWidgetSizeChanged() {
60 }
61
62 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698