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

Unified Diff: ui/aura/env.cc

Issue 2803523002: Always create ClientNativePixmapFactory in chrome --mash (Closed)
Patch Set: rebased Created 3 years, 8 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/aura/env.h ('k') | ui/gfx/client_native_pixmap_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/env.cc
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index 7f9eba981cc7a00bcf5c17f8202dad5236c828cb..829e84a4a79ad6a82fac455ec7e0fb853b23a018 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -21,6 +21,7 @@
#include "ui/events/platform/platform_event_source.h"
#if defined(USE_OZONE)
+#include "ui/ozone/public/client_native_pixmap_factory_ozone.h"
#include "ui/ozone/public/ozone_platform.h"
#endif
@@ -41,6 +42,10 @@ Env::~Env() {
if (is_os_exchange_data_provider_factory_)
ui::OSExchangeDataProviderFactory::SetFactory(nullptr);
+#if defined(USE_OZONE)
+ gfx::ClientNativePixmapFactory::ResetInstance();
+#endif
+
for (EnvObserver& observer : observers_)
observer.OnWillDestroyEnv();
@@ -138,6 +143,9 @@ Env::Env(Mode mode)
is_touch_down_(false),
get_last_mouse_location_from_mus_(mode_ == Mode::MUS),
input_state_lookup_(InputStateLookup::Create()),
+#if defined(USE_OZONE)
+ native_pixmap_factory_(ui::CreateClientNativePixmapFactoryOzone()),
+#endif
context_factory_(nullptr),
context_factory_private_(nullptr) {
DCHECK(lazy_tls_ptr.Pointer()->Get() == NULL);
@@ -147,6 +155,10 @@ Env::Env(Mode mode)
void Env::Init() {
if (mode_ == Mode::MUS) {
EnableMusOSExchangeDataProvider();
+#if defined(USE_OZONE)
+ // Required by all Aura-using clients of services/ui
+ gfx::ClientNativePixmapFactory::SetInstance(native_pixmap_factory_.get());
+#endif
return;
}
@@ -155,6 +167,7 @@ void Env::Init() {
// platform before creating the default event source. If running inside mus
// let the mus process initialize ozone instead.
ui::OzonePlatform::InitializeForUI();
+ gfx::ClientNativePixmapFactory::SetInstance(native_pixmap_factory_.get());
#endif
if (!ui::PlatformEventSource::GetInstance())
event_source_ = ui::PlatformEventSource::CreateDefault();
« no previous file with comments | « ui/aura/env.h ('k') | ui/gfx/client_native_pixmap_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698