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

Side by Side Diff: trunk/src/ui/compositor/test/test_compositor_host_x11.cc

Issue 359103004: Revert 280493 "Make SingleThreadProxy a SchedulerClient" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 months 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/test/test_compositor_host.h" 5 #include "ui/compositor/test/test_compositor_host.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 12 matching lines...) Expand all
23 public: 23 public:
24 TestCompositorHostX11(const gfx::Rect& bounds, 24 TestCompositorHostX11(const gfx::Rect& bounds,
25 ui::ContextFactory* context_factory); 25 ui::ContextFactory* context_factory);
26 virtual ~TestCompositorHostX11(); 26 virtual ~TestCompositorHostX11();
27 27
28 private: 28 private:
29 // Overridden from TestCompositorHost: 29 // Overridden from TestCompositorHost:
30 virtual void Show() OVERRIDE; 30 virtual void Show() OVERRIDE;
31 virtual ui::Compositor* GetCompositor() OVERRIDE; 31 virtual ui::Compositor* GetCompositor() OVERRIDE;
32 32
33 void Draw();
34
33 gfx::Rect bounds_; 35 gfx::Rect bounds_;
34 36
35 ui::ContextFactory* context_factory_; 37 ui::ContextFactory* context_factory_;
36 38
37 scoped_ptr<ui::Compositor> compositor_; 39 scoped_ptr<ui::Compositor> compositor_;
38 40
39 XID window_; 41 XID window_;
40 42
41 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostX11); 43 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostX11);
42 }; 44 };
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 break; 76 break;
75 } 77 }
76 compositor_.reset(new ui::Compositor(window_, context_factory_)); 78 compositor_.reset(new ui::Compositor(window_, context_factory_));
77 compositor_->SetScaleAndSize(1.0f, bounds_.size()); 79 compositor_->SetScaleAndSize(1.0f, bounds_.size());
78 } 80 }
79 81
80 ui::Compositor* TestCompositorHostX11::GetCompositor() { 82 ui::Compositor* TestCompositorHostX11::GetCompositor() {
81 return compositor_.get(); 83 return compositor_.get();
82 } 84 }
83 85
86 void TestCompositorHostX11::Draw() {
87 if (compositor_.get())
88 compositor_->Draw();
89 }
90
84 // static 91 // static
85 TestCompositorHost* TestCompositorHost::Create( 92 TestCompositorHost* TestCompositorHost::Create(
86 const gfx::Rect& bounds, 93 const gfx::Rect& bounds,
87 ui::ContextFactory* context_factory) { 94 ui::ContextFactory* context_factory) {
88 return new TestCompositorHostX11(bounds, context_factory); 95 return new TestCompositorHostX11(bounds, context_factory);
89 } 96 }
90 97
91 } // namespace ui 98 } // namespace ui
OLDNEW
« no previous file with comments | « trunk/src/ui/compositor/test/test_compositor_host_win.cc ('k') | trunk/src/ui/snapshot/snapshot_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698