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

Unified Diff: ui/gfx/compositor/test_compositor_host_linux.cc

Issue 8533019: Add two pixel-based compositor unittests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing images from this CL Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/compositor/test_compositor_host.h ('k') | ui/gfx/compositor/test_compositor_host_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/test_compositor_host_linux.cc
diff --git a/ui/gfx/compositor/test_compositor_host_linux.cc b/ui/gfx/compositor/test_compositor_host_linux.cc
deleted file mode 100644
index f3dba949694af5f69689f579bb089f1a0ccac2ae..0000000000000000000000000000000000000000
--- a/ui/gfx/compositor/test_compositor_host_linux.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) 2011 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/gfx/compositor/test_compositor_host.h"
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "base/logging.h"
-#include "ui/base/x/x11_util.h"
-#include "ui/gfx/compositor/compositor.h"
-#include "ui/gfx/rect.h"
-
-#include <X11/Xlib.h>
-
-#if defined(TOUCH_UI) || defined(USE_AURA)
-#include "base/message_pump_x.h"
-#endif
-
-namespace ui {
-
-class TestCompositorHostLinux : public TestCompositorHost,
- public CompositorDelegate {
- public:
- TestCompositorHostLinux(const gfx::Rect& bounds);
- virtual ~TestCompositorHostLinux();
-
- private:
- // Overridden from TestCompositorHost:
- virtual void Show() OVERRIDE;
- virtual ui::Compositor* GetCompositor() OVERRIDE;
-
- // Overridden from CompositorDelegate:
- virtual void ScheduleDraw() OVERRIDE;
-
- // Overridden from MessagePumpDispatcher:
-#if defined(TOUCH_UI) || defined(USE_AURA)
- virtual base::MessagePumpDispatcher::DispatchStatus
- Dispatch(XEvent* xev) OVERRIDE;
-#elif defined(TOOLKIT_USES_GTK)
- virtual bool Dispatch(GdkEvent* event) OVERRIDE;
-#endif
-
- gfx::Rect bounds_;
-
- scoped_refptr<ui::Compositor> compositor_;
-
- Display* display_;
-
- XID window_;
-
- DISALLOW_COPY_AND_ASSIGN(TestCompositorHostLinux);
-};
-
-TestCompositorHostLinux::TestCompositorHostLinux(const gfx::Rect& bounds)
- : bounds_(bounds) {
-}
-
-TestCompositorHostLinux::~TestCompositorHostLinux() {
- XDestroyWindow(display_, window_);
-}
-
-void TestCompositorHostLinux::Show() {
- display_ = XOpenDisplay(NULL);
- XSetWindowAttributes swa;
- swa.event_mask = StructureNotifyMask | ExposureMask;
- swa.override_redirect = True;
- window_ = XCreateWindow(
- display_,
- RootWindow(display_, DefaultScreen(display_)), // parent
- bounds_.x(), bounds_.y(), bounds_.width(), bounds_.height(),
- 0, // border width
- CopyFromParent, // depth
- InputOutput,
- CopyFromParent, // visual
- CWEventMask | CWOverrideRedirect, &swa);
- XMapWindow(display_, window_);
-
- while (1) {
- XEvent event;
- XNextEvent(display_, &event);
- if (event.type == MapNotify && event.xmap.window == window_)
- break;
- }
- compositor_ = ui::Compositor::Create(this, window_, bounds_.size());
-}
-
-ui::Compositor* TestCompositorHostLinux::GetCompositor() {
- return compositor_;
-}
-
-void TestCompositorHostLinux::ScheduleDraw() {
- if (compositor_)
- compositor_->Draw(false);
-}
-
-#if defined(TOUCH_UI) || defined(USE_AURA)
-base::MessagePumpDispatcher::DispatchStatus TestCompositorHostLinux::Dispatch(
- XEvent* xev) {
- return MessagePumpDispatcher::EVENT_IGNORED;
-}
-#elif defined(TOOLKIT_USES_GTK)
-bool TestCompositorHostLinux::Dispatch(GdkEvent*) {
- return false;
-}
-#endif
-
-// static
-TestCompositorHost* TestCompositorHost::Create(const gfx::Rect& bounds) {
- return new TestCompositorHostLinux(bounds);
-}
-
-} // namespace ui
« no previous file with comments | « ui/gfx/compositor/test_compositor_host.h ('k') | ui/gfx/compositor/test_compositor_host_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698