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

Unified Diff: services/native_viewport/native_viewport_impl.cc

Issue 1168993002: Update the native_viewport interface to allow specification of the surface configuration, currently… (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Hopefully got all of the linux compile issues now... Created 5 years, 6 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: services/native_viewport/native_viewport_impl.cc
diff --git a/services/native_viewport/native_viewport_impl.cc b/services/native_viewport/native_viewport_impl.cc
index f39f53b3f9bad9bf35df8d60a8d2dc9442a3bc8d..0a3da2330c51f12b5aa57c7d1098ac72b321c98f 100644
--- a/services/native_viewport/native_viewport_impl.cc
+++ b/services/native_viewport/native_viewport_impl.cc
@@ -10,10 +10,12 @@
#include "base/message_loop/message_loop.h"
#include "base/time/time.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "mojo/converters/native_viewport/surface_configuration_type_converters.h"
#include "mojo/public/cpp/application/interface_factory.h"
#include "services/gles2/gpu_state.h"
#include "services/native_viewport/platform_viewport_headless.h"
#include "ui/events/event.h"
+#include "ui/gl/gl_surface.h"
namespace native_viewport {
@@ -36,10 +38,19 @@ NativeViewportImpl::~NativeViewportImpl() {
platform_viewport_.reset();
}
-void NativeViewportImpl::Create(mojo::SizePtr size,
- const CreateCallback& callback) {
+void NativeViewportImpl::Create(
+ mojo::SizePtr size,
+ mojo::SurfaceConfigurationPtr requested_configuration,
+ const CreateCallback& callback) {
+
viettrungluu 2015/06/09 22:38:35 nit: no blank line here
iansf 2015/06/09 23:45:26 Done.
+ if (requested_configuration == nullptr) {
viettrungluu 2015/06/09 22:38:35 nit: for consistency with the rest of the file, om
iansf 2015/06/09 23:45:26 Done.
+ requested_configuration = mojo::SurfaceConfiguration::New();
+ }
+
create_callback_ = callback;
metrics_->size = size.Clone();
+ context_provider_.set_surface_configuration(
+ requested_configuration.To<gfx::SurfaceConfiguration>());
if (is_headless_)
platform_viewport_ = PlatformViewportHeadless::Create(this);
else

Powered by Google App Engine
This is Rietveld 408576698