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

Unified Diff: mojo/services/native_viewport/native_viewport_impl.cc

Issue 534843002: Convert view manager to surfaces with uploading shim in client lib (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove overzealous shutdown check in cc/surfaces, add NON_EXPORTED_BASE for windows build, saturate… Created 6 years, 3 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: mojo/services/native_viewport/native_viewport_impl.cc
diff --git a/mojo/services/native_viewport/native_viewport_impl.cc b/mojo/services/native_viewport/native_viewport_impl.cc
index 47de6929265eb8cbcd404f35cb0eae74b3ed964f..a0ab9993321c63eb23be1c55c6d5f284d1758549 100644
--- a/mojo/services/native_viewport/native_viewport_impl.cc
+++ b/mojo/services/native_viewport/native_viewport_impl.cc
@@ -41,10 +41,11 @@ NativeViewportImpl::~NativeViewportImpl() {
platform_viewport_.reset();
}
-void NativeViewportImpl::Create(RectPtr bounds) {
+void NativeViewportImpl::Create(SizePtr bounds) {
platform_viewport_ = PlatformViewport::Create(this);
- platform_viewport_->Init(bounds.To<gfx::Rect>());
- OnBoundsChanged(bounds.To<gfx::Rect>());
+ gfx::Rect rect = gfx::Rect(bounds.To<gfx::Size>());
+ platform_viewport_->Init(rect);
+ OnBoundsChanged(rect);
}
void NativeViewportImpl::Show() {
@@ -60,8 +61,8 @@ void NativeViewportImpl::Close() {
platform_viewport_->Close();
}
-void NativeViewportImpl::SetBounds(RectPtr bounds) {
- platform_viewport_->SetBounds(bounds.To<gfx::Rect>());
+void NativeViewportImpl::SetBounds(SizePtr bounds) {
+ platform_viewport_->SetBounds(gfx::Rect(bounds.To<gfx::Size>()));
}
void NativeViewportImpl::SubmittedFrame(SurfaceIdPtr child_surface_id) {
@@ -73,7 +74,7 @@ void NativeViewportImpl::SubmittedFrame(SurfaceIdPtr child_surface_id) {
viewport_surface_.reset(
new ViewportSurface(surfaces_service_.get(),
gpu_service_.get(),
- bounds_,
+ bounds_.size(),
child_surface_id.To<cc::SurfaceId>()));
if (widget_id_)
viewport_surface_->SetWidgetId(widget_id_);
@@ -85,9 +86,9 @@ void NativeViewportImpl::SubmittedFrame(SurfaceIdPtr child_surface_id) {
void NativeViewportImpl::OnBoundsChanged(const gfx::Rect& bounds) {
bounds_ = bounds;
- client()->OnBoundsChanged(Rect::From(bounds));
+ client()->OnBoundsChanged(Size::From(bounds.size()));
if (viewport_surface_)
- viewport_surface_->SetBounds(bounds);
+ viewport_surface_->SetSize(bounds.size());
}
void NativeViewportImpl::OnAcceleratedWidgetAvailable(
« no previous file with comments | « mojo/services/native_viewport/native_viewport_impl.h ('k') | mojo/services/native_viewport/viewport_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698