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

Unified Diff: ui/views/mus/platform_window_mus.cc

Issue 1634103002: views/mus: Make PlatformWindowMus be responsible for setting-up the BitmapUploader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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
« no previous file with comments | « ui/views/mus/platform_window_mus.h ('k') | ui/views/mus/window_tree_host_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/mus/platform_window_mus.cc
diff --git a/ui/views/mus/platform_window_mus.cc b/ui/views/mus/platform_window_mus.cc
index 407d82017e405c853ef978b94206174826746d42..7233c4cb236e48da36f61323c094b13e66ed3cf8 100644
--- a/ui/views/mus/platform_window_mus.cc
+++ b/ui/views/mus/platform_window_mus.cc
@@ -5,10 +5,12 @@
#include "ui/views/mus/platform_window_mus.h"
#include "build/build_config.h"
+#include "components/bitmap_uploader/bitmap_uploader.h"
#include "components/mus/public/cpp/property_type_converters.h"
#include "components/mus/public/cpp/window_property.h"
#include "components/mus/public/interfaces/window_manager.mojom.h"
#include "mojo/converters/input_events/input_events_type_converters.h"
+#include "ui/base/view_prop.h"
#include "ui/platform_window/platform_window_delegate.h"
#include "ui/views/mus/window_manager_connection.h"
@@ -20,6 +22,7 @@ static uint32_t accelerated_widget_count = 1;
} // namespace
PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate,
+ mojo::Shell* shell,
mus::Window* mus_window)
: delegate_(delegate),
mus_window_(mus_window),
@@ -36,14 +39,20 @@ PlatformWindowMus::PlatformWindowMus(ui::PlatformWindowDelegate* delegate,
// window and fit in the smallest sizeof(AcceleratedWidget) uint32_t
// has this property.
#if defined(OS_WIN) || defined(OS_ANDROID)
- delegate_->OnAcceleratedWidgetAvailable(
- reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++),
- mus_window_->viewport_metrics().device_pixel_ratio);
+ gfx::AcceleratedWidget accelerated_widget =
+ reinterpret_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
#else
- delegate_->OnAcceleratedWidgetAvailable(
- static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++),
- mus_window_->viewport_metrics().device_pixel_ratio);
+ gfx::AcceleratedWidget accelerated_widget =
+ static_cast<gfx::AcceleratedWidget>(accelerated_widget_count++);
#endif
+ delegate_->OnAcceleratedWidgetAvailable(
+ accelerated_widget, mus_window_->viewport_metrics().device_pixel_ratio);
+
+ bitmap_uploader_.reset(new bitmap_uploader::BitmapUploader(mus_window_));
+ bitmap_uploader_->Init(shell);
+ prop_.reset(new ui::ViewProp(
+ accelerated_widget, bitmap_uploader::kBitmapUploaderForAcceleratedWidget,
+ bitmap_uploader_.get()));
}
PlatformWindowMus::~PlatformWindowMus() {
« no previous file with comments | « ui/views/mus/platform_window_mus.h ('k') | ui/views/mus/window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698