| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 TestCompositorHostOzone::~TestCompositorHostOzone() {} | 47 TestCompositorHostOzone::~TestCompositorHostOzone() {} |
| 48 | 48 |
| 49 void TestCompositorHostOzone::Show() { | 49 void TestCompositorHostOzone::Show() { |
| 50 // Ozone should rightly have a backing native framebuffer | 50 // Ozone should rightly have a backing native framebuffer |
| 51 // An in-memory array draw into by OSMesa is a reasonble | 51 // An in-memory array draw into by OSMesa is a reasonble |
| 52 // fascimile of a dumb framebuffer at present. | 52 // fascimile of a dumb framebuffer at present. |
| 53 // GLSurface will allocate the array so long as it is provided | 53 // GLSurface will allocate the array so long as it is provided |
| 54 // with a non-0 widget. | 54 // with a non-0 widget. |
| 55 // TODO(rjkroege): Use a "real" ozone widget when it is | 55 // TODO(rjkroege): Use a "real" ozone widget when it is |
| 56 // available: http://crbug.com/255128 | 56 // available: http://crbug.com/255128 |
| 57 compositor_.reset(new ui::Compositor(1, context_factory_)); | 57 compositor_.reset(new ui::Compositor(1, |
| 58 context_factory_, |
| 59 base::MessageLoopProxy::current())); |
| 58 compositor_->SetScaleAndSize(1.0f, bounds_.size()); | 60 compositor_->SetScaleAndSize(1.0f, bounds_.size()); |
| 59 } | 61 } |
| 60 | 62 |
| 61 ui::Compositor* TestCompositorHostOzone::GetCompositor() { | 63 ui::Compositor* TestCompositorHostOzone::GetCompositor() { |
| 62 return compositor_.get(); | 64 return compositor_.get(); |
| 63 } | 65 } |
| 64 | 66 |
| 65 void TestCompositorHostOzone::Draw() { | 67 void TestCompositorHostOzone::Draw() { |
| 66 if (compositor_.get()) | 68 if (compositor_.get()) |
| 67 compositor_->Draw(); | 69 compositor_->Draw(); |
| 68 } | 70 } |
| 69 | 71 |
| 70 // static | 72 // static |
| 71 TestCompositorHost* TestCompositorHost::Create( | 73 TestCompositorHost* TestCompositorHost::Create( |
| 72 const gfx::Rect& bounds, | 74 const gfx::Rect& bounds, |
| 73 ui::ContextFactory* context_factory) { | 75 ui::ContextFactory* context_factory) { |
| 74 return new TestCompositorHostOzone(bounds, context_factory); | 76 return new TestCompositorHostOzone(bounds, context_factory); |
| 75 } | 77 } |
| 76 | 78 |
| 77 } // namespace ui | 79 } // namespace ui |
| OLD | NEW |