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

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

Issue 8873001: Revert 113470 - Makes tests either use mock compositor or mock WebGraphicsContext3D depending upo... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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_cc.h ('k') | ui/gfx/compositor/compositor_setup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/compositor_cc.cc
===================================================================
--- ui/gfx/compositor/compositor_cc.cc (revision 113506)
+++ ui/gfx/compositor/compositor_cc.cc (working copy)
@@ -22,12 +22,7 @@
#include "webkit/gpu/webgraphicscontext3d_in_process_impl.h"
namespace {
-
webkit_glue::WebThreadImpl* g_compositor_thread = NULL;
-
-// If true a context is used that results in no rendering to the screen.
-bool test_context_enabled = false;
-
} // anonymous namespace
namespace ui {
@@ -126,6 +121,9 @@
NOTREACHED();
}
+// static
+bool CompositorCC::test_context_enabled_ = false;
+
CompositorCC::CompositorCC(CompositorDelegate* delegate,
gfx::AcceleratedWidget widget,
const gfx::Size& size)
@@ -174,6 +172,12 @@
}
}
+// static
+void CompositorCC::EnableTestContextIfNecessary() {
+ // TODO: only do this if command line param not set.
+ test_context_enabled_ = true;
+}
+
Texture* CompositorCC::CreateTexture() {
NOTREACHED();
return NULL;
@@ -243,7 +247,7 @@
WebKit::WebGraphicsContext3D* CompositorCC::createContext3D() {
WebKit::WebGraphicsContext3D* context;
- if (test_context_enabled) {
+ if (test_context_enabled_) {
context = new TestWebGraphicsContext3D();
} else {
gfx::GLShareGroup* share_group =
@@ -282,15 +286,4 @@
return new CompositorCC(owner, widget, size);
}
-COMPOSITOR_EXPORT void SetupTestCompositor() {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableTestCompositor)) {
- test_context_enabled = true;
- }
-}
-
-COMPOSITOR_EXPORT void DisableTestCompositor() {
- test_context_enabled = false;
-}
-
} // namespace ui
« no previous file with comments | « ui/gfx/compositor/compositor_cc.h ('k') | ui/gfx/compositor/compositor_setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698