Commit cf70d8a8 authored by sky@chromium.org's avatar sky@chromium.org

Removes usage of Compositor/ContextFactory methods

ContextFactory::Set/GetInstance is going away and not necessary
anymore.

BUG=none
TEST=none
R=ben@chromium.org

Review URL: https://codereview.chromium.org/306123007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273926 0039d316-1c4b-4281-b951-d872f2087c98
parent 89509acf
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "ui/aura/client/capture_client.h" #include "ui/aura/client/capture_client.h"
#include "ui/aura/env.h"
#include "ui/aura/window_delegate.h" #include "ui/aura/window_delegate.h"
#include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h" #include "ui/aura/window_tree_host.h"
...@@ -109,7 +110,7 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) { ...@@ -109,7 +110,7 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) {
host->window()->AddChild(mirror_window); host->window()->AddChild(mirror_window);
mirror_window->SetBounds(host->window()->bounds()); mirror_window->SetBounds(host->window()->bounds());
mirror_window->Show(); mirror_window->Show();
reflector_ = ui::ContextFactory::GetInstance()->CreateReflector( reflector_ = aura::Env::GetInstance()->context_factory()->CreateReflector(
Shell::GetPrimaryRootWindow()->GetHost()->compositor(), Shell::GetPrimaryRootWindow()->GetHost()->compositor(),
mirror_window->layer()); mirror_window->layer());
} else { } else {
...@@ -140,7 +141,7 @@ void MirrorWindowController::UpdateWindow() { ...@@ -140,7 +141,7 @@ void MirrorWindowController::UpdateWindow() {
void MirrorWindowController::Close() { void MirrorWindowController::Close() {
if (ash_host_.get()) { if (ash_host_.get()) {
aura::WindowTreeHost* host = ash_host_->AsWindowTreeHost(); aura::WindowTreeHost* host = ash_host_->AsWindowTreeHost();
ui::ContextFactory::GetInstance()->RemoveReflector(reflector_); aura::Env::GetInstance()->context_factory()->RemoveReflector(reflector_);
reflector_ = NULL; reflector_ = NULL;
NoneCaptureClient* capture_client = static_cast<NoneCaptureClient*>( NoneCaptureClient* capture_client = static_cast<NoneCaptureClient*>(
aura::client::GetCaptureClient(host->window())); aura::client::GetCaptureClient(host->window()));
......
...@@ -40,12 +40,10 @@ WindowTreeHostMojo::WindowTreeHostMojo( ...@@ -40,12 +40,10 @@ WindowTreeHostMojo::WindowTreeHostMojo(
// The ContextFactory must exist before any Compositors are created. // The ContextFactory must exist before any Compositors are created.
if (context_factory_) { if (context_factory_) {
ui::ContextFactory::SetInstance(NULL);
delete context_factory_; delete context_factory_;
context_factory_ = NULL; context_factory_ = NULL;
} }
context_factory_ = new ContextFactoryMojo(pipe.handle1.Pass()); context_factory_ = new ContextFactoryMojo(pipe.handle1.Pass());
ui::ContextFactory::SetInstance(context_factory_);
aura::Env::GetInstance()->set_context_factory(context_factory_); aura::Env::GetInstance()->set_context_factory(context_factory_);
CHECK(context_factory_) << "No GL bindings."; CHECK(context_factory_) << "No GL bindings.";
} }
......
...@@ -299,7 +299,6 @@ int main(int argc, char** argv) { ...@@ -299,7 +299,6 @@ int main(int argc, char** argv) {
// The ContextFactory must exist before any Compositors are created. // The ContextFactory must exist before any Compositors are created.
scoped_ptr<ui::InProcessContextFactory> context_factory( scoped_ptr<ui::InProcessContextFactory> context_factory(
new ui::InProcessContextFactory()); new ui::InProcessContextFactory());
ui::ContextFactory::SetInstance(context_factory.get());
base::i18n::InitializeICU(); base::i18n::InitializeICU();
......
...@@ -123,7 +123,6 @@ int DemoMain() { ...@@ -123,7 +123,6 @@ int DemoMain() {
// The ContextFactory must exist before any Compositors are created. // The ContextFactory must exist before any Compositors are created.
scoped_ptr<ui::InProcessContextFactory> context_factory( scoped_ptr<ui::InProcessContextFactory> context_factory(
new ui::InProcessContextFactory()); new ui::InProcessContextFactory());
ui::ContextFactory::SetInstance(context_factory.get());
// Create the message-loop here before creating the root window. // Create the message-loop here before creating the root window.
base::MessageLoopForUI message_loop; base::MessageLoopForUI message_loop;
......
...@@ -30,12 +30,10 @@ ui::ContextFactory* InitializeContextFactoryForTests(bool enable_pixel_output) { ...@@ -30,12 +30,10 @@ ui::ContextFactory* InitializeContextFactoryForTests(bool enable_pixel_output) {
if (enable_pixel_output) if (enable_pixel_output)
g_disable_null_draw = new gfx::DisableNullDrawGLBindings; g_disable_null_draw = new gfx::DisableNullDrawGLBindings;
g_implicit_factory = new InProcessContextFactory(); g_implicit_factory = new InProcessContextFactory();
ContextFactory::SetInstance(g_implicit_factory);
return g_implicit_factory; return g_implicit_factory;
} }
void TerminateContextFactoryForTests() { void TerminateContextFactoryForTests() {
ContextFactory::SetInstance(NULL);
delete g_implicit_factory; delete g_implicit_factory;
g_implicit_factory = NULL; g_implicit_factory = NULL;
delete g_disable_null_draw; delete g_disable_null_draw;
......
...@@ -53,7 +53,6 @@ int main(int argc, char** argv) { ...@@ -53,7 +53,6 @@ int main(int argc, char** argv) {
// The ContextFactory must exist before any Compositors are created. // The ContextFactory must exist before any Compositors are created.
scoped_ptr<ui::InProcessContextFactory> context_factory( scoped_ptr<ui::InProcessContextFactory> context_factory(
new ui::InProcessContextFactory()); new ui::InProcessContextFactory());
ui::ContextFactory::SetInstance(context_factory.get());
base::MessageLoopForUI message_loop; base::MessageLoopForUI message_loop;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment