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

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: 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..201339042f7efa80406b2b24be8d1f32bad5bf37 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>());
+ platform_viewport_->Init(
+ gfx::Rect(gfx::Point(10, 10), bounds.To<gfx::Size>()));
+ OnBoundsChanged(gfx::Rect(bounds.To<gfx::Size>()));
}
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) {
@@ -85,7 +86,7 @@ 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);
}

Powered by Google App Engine
This is Rietveld 408576698