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

Side by Side Diff: ui/compositor/test/test_compositor_host_ozone.cc

Issue 1995963002: Fix "unused variable" warnings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo accidental change Created 4 years, 7 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
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 <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 12 matching lines...) Expand all
23 ui::ContextFactory* context_factory); 23 ui::ContextFactory* context_factory);
24 ~TestCompositorHostOzone() override; 24 ~TestCompositorHostOzone() override;
25 25
26 private: 26 private:
27 // Overridden from TestCompositorHost: 27 // Overridden from TestCompositorHost:
28 void Show() override; 28 void Show() override;
29 ui::Compositor* GetCompositor() override; 29 ui::Compositor* GetCompositor() override;
30 30
31 gfx::Rect bounds_; 31 gfx::Rect bounds_;
32 32
33 ui::ContextFactory* context_factory_;
34
35 ui::Compositor compositor_; 33 ui::Compositor compositor_;
36 34
37 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostOzone); 35 DISALLOW_COPY_AND_ASSIGN(TestCompositorHostOzone);
38 }; 36 };
39 37
40 TestCompositorHostOzone::TestCompositorHostOzone( 38 TestCompositorHostOzone::TestCompositorHostOzone(
41 const gfx::Rect& bounds, 39 const gfx::Rect& bounds,
42 ui::ContextFactory* context_factory) 40 ui::ContextFactory* context_factory)
43 : bounds_(bounds), 41 : bounds_(bounds),
44 context_factory_(context_factory),
45 compositor_(context_factory, base::ThreadTaskRunnerHandle::Get()) {} 42 compositor_(context_factory, base::ThreadTaskRunnerHandle::Get()) {}
46 43
47 TestCompositorHostOzone::~TestCompositorHostOzone() {} 44 TestCompositorHostOzone::~TestCompositorHostOzone() {}
48 45
49 void TestCompositorHostOzone::Show() { 46 void TestCompositorHostOzone::Show() {
50 // Ozone should rightly have a backing native framebuffer 47 // Ozone should rightly have a backing native framebuffer
51 // An in-memory array draw into by OSMesa is a reasonble 48 // An in-memory array draw into by OSMesa is a reasonble
52 // fascimile of a dumb framebuffer at present. 49 // fascimile of a dumb framebuffer at present.
53 // GLSurface will allocate the array so long as it is provided 50 // GLSurface will allocate the array so long as it is provided
54 // with a non-0 widget. 51 // with a non-0 widget.
55 // TODO(rjkroege): Use a "real" ozone widget when it is 52 // TODO(rjkroege): Use a "real" ozone widget when it is
56 // available: http://crbug.com/255128 53 // available: http://crbug.com/255128
57 compositor_.SetAcceleratedWidget(1); 54 compositor_.SetAcceleratedWidget(1);
58 compositor_.SetScaleAndSize(1.0f, bounds_.size()); 55 compositor_.SetScaleAndSize(1.0f, bounds_.size());
59 } 56 }
60 57
61 ui::Compositor* TestCompositorHostOzone::GetCompositor() { 58 ui::Compositor* TestCompositorHostOzone::GetCompositor() {
62 return &compositor_; 59 return &compositor_;
63 } 60 }
64 61
65 // static 62 // static
66 TestCompositorHost* TestCompositorHost::Create( 63 TestCompositorHost* TestCompositorHost::Create(
67 const gfx::Rect& bounds, 64 const gfx::Rect& bounds,
68 ui::ContextFactory* context_factory) { 65 ui::ContextFactory* context_factory) {
69 return new TestCompositorHostOzone(bounds, context_factory); 66 return new TestCompositorHostOzone(bounds, context_factory);
70 } 67 }
71 68
72 } // namespace ui 69 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698