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

Unified Diff: ui/aura/env.cc

Issue 2803523002: Always create ClientNativePixmapFactory in chrome --mash (Closed)
Patch Set: better location for pixmap factory init 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') | no next file » | 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 9436b2be50f4a95bc40322d8bef9a0a43b4b202c..883ba7f2b0e2bddf5a377d63889c309149678486 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -23,6 +23,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
@@ -189,6 +190,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);
@@ -198,6 +202,10 @@ Env::Env(Mode mode)
void Env::Init() {
sky 2017/04/07 23:23:19 Be aware that some tests reset the mode after the
rjkroege 2017/04/10 16:21:42 I don't understand what you mean. They do this by
if (RunningInsideMus()) {
EnableMusOSExchangeDataProvider();
+#if defined(USE_OZONE)
+ // Required by all Aura-using clients of services/ui
+ gfx::ClientNativePixmapFactory::SetInstance(native_pixmap_factory_.get());
+#endif
return;
}
@@ -206,6 +214,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());
sky 2017/04/07 23:23:20 SetInstance(null) in the destructor?
rjkroege 2017/04/10 16:21:42 Done.
#endif
if (!ui::PlatformEventSource::GetInstance())
event_source_ = ui::PlatformEventSource::CreateDefault();
« no previous file with comments | « ui/aura/env.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698