summaryrefslogtreecommitdiff
path: root/chromium/ui/compositor/test/test_compositor_host_ozone.cc
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@digia.com>2014-05-22 18:24:25 +0200
committerAndras Becsi <andras.becsi@digia.com>2014-06-04 16:32:40 +0200
commit4ce69f7403811819800e7c5ae1318b2647e778d1 (patch)
tree2ec3a98b5abef002670a0916354eb7e0abfe2aa2 /chromium/ui/compositor/test/test_compositor_host_ozone.cc
parenta6dd70e0328d155d5df8d6df48afbab690b08fb6 (diff)
downloadqtwebengine-chromium-4ce69f7403811819800e7c5ae1318b2647e778d1.tar.gz
Update Chromium snapshot to stable version 33.0.1750.170
This is meant as a baseline commit hence it does not include the patches we need to apply for QtWebEngine. All patches should be rebased on top of this commit so we can get rid of the external patches directory. In future these baseline commits always have to include the exact Chromium version returned by version_resolver.py's currentVersion() in their first line, so that we can retrieve the patches on top to apply on the upstream repository. This also includes a ninja update. Change-Id: I60abeadb785a3b7d149c58b65ddb5a823fed3083 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'chromium/ui/compositor/test/test_compositor_host_ozone.cc')
-rw-r--r--chromium/ui/compositor/test/test_compositor_host_ozone.cc69
1 files changed, 69 insertions, 0 deletions
diff --git a/chromium/ui/compositor/test/test_compositor_host_ozone.cc b/chromium/ui/compositor/test/test_compositor_host_ozone.cc
new file mode 100644
index 00000000000..78431bee417
--- /dev/null
+++ b/chromium/ui/compositor/test/test_compositor_host_ozone.cc
@@ -0,0 +1,69 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/compositor/test/test_compositor_host.h"
+
+#include "base/basictypes.h"
+#include "base/bind.h"
+#include "base/compiler_specific.h"
+#include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/message_loop/message_loop.h"
+#include "ui/compositor/compositor.h"
+#include "ui/gfx/rect.h"
+
+namespace ui {
+
+class TestCompositorHostOzone : public TestCompositorHost {
+ public:
+ TestCompositorHostOzone(const gfx::Rect& bounds);
+ virtual ~TestCompositorHostOzone();
+
+ private:
+ // Overridden from TestCompositorHost:
+ virtual void Show() OVERRIDE;
+ virtual ui::Compositor* GetCompositor() OVERRIDE;
+
+ void Draw();
+
+ gfx::Rect bounds_;
+
+ scoped_ptr<ui::Compositor> compositor_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestCompositorHostOzone);
+};
+
+TestCompositorHostOzone::TestCompositorHostOzone(const gfx::Rect& bounds)
+ : bounds_(bounds) {}
+
+TestCompositorHostOzone::~TestCompositorHostOzone() {}
+
+void TestCompositorHostOzone::Show() {
+ // Ozone should rightly have a backing native framebuffer
+ // An in-memory array draw into by OSMesa is a reasonble
+ // fascimile of a dumb framebuffer at present.
+ // GLSurface will allocate the array so long as it is provided
+ // with a non-0 widget.
+ // TODO(rjkroege): Use a "real" ozone widget when it is
+ // available: http://crbug.com/255128
+ compositor_.reset(new ui::Compositor(1));
+ compositor_->SetScaleAndSize(1.0f, bounds_.size());
+}
+
+ui::Compositor* TestCompositorHostOzone::GetCompositor() {
+ return compositor_.get();
+}
+
+void TestCompositorHostOzone::Draw() {
+ if (compositor_.get())
+ compositor_->Draw();
+}
+
+// static
+TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) {
+ return new TestCompositorHostOzone(bounds);
+}
+
+} // namespace ui