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

Unified Diff: ui/compositor/test/context_factories_for_test.cc

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initgl: Created 6 years, 11 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
Index: ui/compositor/test/context_factories_for_test.cc
diff --git a/ui/compositor/test/context_factories_for_test.cc b/ui/compositor/test/context_factories_for_test.cc
index 795f56d3b4fa57d879a10db307ec27d5eb84f1bb..b03fa347ced7bf51327f32596330e911ced78540 100644
--- a/ui/compositor/test/context_factories_for_test.cc
+++ b/ui/compositor/test/context_factories_for_test.cc
@@ -10,6 +10,7 @@
#include "ui/compositor/compositor_switches.h"
#include "ui/compositor/test/default_context_factory.h"
#include "ui/compositor/test/test_context_factory.h"
+#include "ui/gl/gl_implementation.h"
namespace ui {
@@ -40,11 +41,9 @@ void InitializeContextFactoryForTests(bool allow_test_contexts) {
if (use_test_contexts) {
g_implicit_factory = new ui::TestContextFactory;
} else {
+ DCHECK_NE(gfx::kGLImplementationNone, gfx::GetGLImplementation());
DVLOG(1) << "Using DefaultContextFactory";
- scoped_ptr<ui::DefaultContextFactory> instance(
- new ui::DefaultContextFactory());
- if (instance->Initialize())
- g_implicit_factory = instance.release();
+ g_implicit_factory = new ui::DefaultContextFactory();
}
ContextFactory::SetInstance(g_implicit_factory);
}

Powered by Google App Engine
This is Rietveld 408576698