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

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

Issue 8222028: Use WebKit compositor in ui::Layer (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/compositor/compositor_test_support.h ('k') | ui/gfx/compositor/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/compositor_test_support.cc
diff --git a/ui/gfx/compositor/compositor_test_support.cc b/ui/gfx/compositor/compositor_test_support.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e72bd0c8204bc5290b1077dbaab1144aa055e212
--- /dev/null
+++ b/ui/gfx/compositor/compositor_test_support.cc
@@ -0,0 +1,35 @@
+// 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/compositor_test_support.h"
+
+#if defined(USE_WEBKIT_COMPOSITOR)
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
+#include "webkit/glue/webkitplatformsupport_impl.h"
+#endif
+
+namespace ui {
+
+#if defined(USE_WEBKIT_COMPOSITOR)
+static webkit_glue::WebKitPlatformSupportImpl* g_webkit_support;
+#endif
+
+void CompositorTestSupport::Initialize() {
+#if defined(USE_WEBKIT_COMPOSITOR)
+ DCHECK(!g_webkit_support);
+ g_webkit_support = new webkit_glue::WebKitPlatformSupportImpl;
+ WebKit::initialize(g_webkit_support);
+#endif
+}
+
+void CompositorTestSupport::Terminate() {
+#if defined(USE_WEBKIT_COMPOSITOR)
+ DCHECK(g_webkit_support);
+ WebKit::shutdown();
+ delete g_webkit_support;
+ g_webkit_support = NULL;
+#endif
+}
+
+} // namespace ui
« no previous file with comments | « ui/gfx/compositor/compositor_test_support.h ('k') | ui/gfx/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698