OLD | NEW |
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 void TestCompositorHostOzone::Show() { | 46 void TestCompositorHostOzone::Show() { |
47 // Ozone should rightly have a backing native framebuffer | 47 // Ozone should rightly have a backing native framebuffer |
48 // An in-memory array draw into by OSMesa is a reasonble | 48 // An in-memory array draw into by OSMesa is a reasonble |
49 // fascimile of a dumb framebuffer at present. | 49 // fascimile of a dumb framebuffer at present. |
50 // GLSurface will allocate the array so long as it is provided | 50 // GLSurface will allocate the array so long as it is provided |
51 // with a non-0 widget. | 51 // with a non-0 widget. |
52 // TODO(rjkroege): Use a "real" ozone widget when it is | 52 // TODO(rjkroege): Use a "real" ozone widget when it is |
53 // available: http://crbug.com/255128 | 53 // available: http://crbug.com/255128 |
54 compositor_.SetAcceleratedWidget(1); | 54 compositor_.SetAcceleratedWidget(1); |
55 compositor_.SetScaleAndSize(1.0f, bounds_.size()); | 55 compositor_.SetScaleAndSize(1.0f, bounds_.size()); |
| 56 compositor_.SetVisible(true); |
56 } | 57 } |
57 | 58 |
58 ui::Compositor* TestCompositorHostOzone::GetCompositor() { | 59 ui::Compositor* TestCompositorHostOzone::GetCompositor() { |
59 return &compositor_; | 60 return &compositor_; |
60 } | 61 } |
61 | 62 |
62 // static | 63 // static |
63 TestCompositorHost* TestCompositorHost::Create( | 64 TestCompositorHost* TestCompositorHost::Create( |
64 const gfx::Rect& bounds, | 65 const gfx::Rect& bounds, |
65 ui::ContextFactory* context_factory) { | 66 ui::ContextFactory* context_factory) { |
66 return new TestCompositorHostOzone(bounds, context_factory); | 67 return new TestCompositorHostOzone(bounds, context_factory); |
67 } | 68 } |
68 | 69 |
69 } // namespace ui | 70 } // namespace ui |
OLD | NEW |