summaryrefslogtreecommitdiffstats
path: root/ui/gfx/compositor/compositor_cc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gfx/compositor/compositor_cc.cc')
-rw-r--r--ui/gfx/compositor/compositor_cc.cc27
1 files changed, 10 insertions, 17 deletions
diff --git a/ui/gfx/compositor/compositor_cc.cc b/ui/gfx/compositor/compositor_cc.cc
index 3b44124..2ebed68 100644
--- a/ui/gfx/compositor/compositor_cc.cc
+++ b/ui/gfx/compositor/compositor_cc.cc
@@ -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 @@ void TextureCC::Draw(const ui::TextureDrawParams& params,
NOTREACHED();
}
+// static
+bool CompositorCC::test_context_enabled_ = false;
+
CompositorCC::CompositorCC(CompositorDelegate* delegate,
gfx::AcceleratedWidget widget,
const gfx::Size& size)
@@ -174,6 +172,12 @@ void CompositorCC::Terminate() {
}
}
+// 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 @@ void CompositorCC::applyScrollDelta(const WebKit::WebSize&) {
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 @@ Compositor* Compositor::Create(CompositorDelegate* owner,
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