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

Unified Diff: mojo/examples/sample_app/sample_app.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
« no previous file with comments | « mojo/examples/pepper_container_app/type_converters.h ('k') | mojo/examples/surfaces_app/surfaces_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/sample_app/sample_app.cc
diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc
index 26376d9ce6dd217a7fe5091802f3c8ddf84c79a6..6379ca3a67e6c4d1d7b3b545faaf7ecda5a6f415 100644
--- a/mojo/examples/sample_app/sample_app.cc
+++ b/mojo/examples/sample_app/sample_app.cc
@@ -36,12 +36,10 @@ class SampleApp : public mojo::ApplicationDelegate,
// TODO(jamesr): Should be mojo:mojo_gpu_service
app->ConnectToService("mojo:mojo_native_viewport_service", &gpu_service_);
- mojo::RectPtr rect(mojo::Rect::New());
- rect->x = 10;
- rect->y = 10;
- rect->width = 800;
- rect->height = 600;
- viewport_->Create(rect.Pass());
+ mojo::SizePtr size(mojo::Size::New());
+ size->width = 800;
+ size->height = 600;
+ viewport_->Create(size.Pass());
viewport_->Show();
}
@@ -58,13 +56,10 @@ class SampleApp : public mojo::ApplicationDelegate,
virtual void OnDestroyed() MOJO_OVERRIDE { mojo::RunLoop::current()->Quit(); }
- virtual void OnBoundsChanged(mojo::RectPtr bounds) MOJO_OVERRIDE {
+ virtual void OnBoundsChanged(mojo::SizePtr bounds) MOJO_OVERRIDE {
assert(bounds);
- mojo::SizePtr size(mojo::Size::New());
- size->width = bounds->width;
- size->height = bounds->height;
if (gles2_client_)
- gles2_client_->SetSize(*size);
+ gles2_client_->SetSize(*bounds);
}
virtual void OnEvent(mojo::EventPtr event,
« no previous file with comments | « mojo/examples/pepper_container_app/type_converters.h ('k') | mojo/examples/surfaces_app/surfaces_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698