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

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: Fix header issue 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..7dddd709de0c649ca2bcf6fe4a09278320fe1f4f 100644
--- a/services/native_viewport/native_viewport_impl.cc
+++ b/services/native_viewport/native_viewport_impl.cc
@@ -10,10 +10,14 @@
#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_implementation.h"
+#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_surface_egl.h"
namespace native_viewport {
@@ -36,10 +40,14 @@ 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) {
create_callback_ = callback;
metrics_->size = size.Clone();
+ context_provider_.SetSurfaceConfiguration(
+ requested_configuration.To<gfx::SurfaceConfiguration>());
viettrungluu 2015/06/09 00:48:15 Is there any validation of requested_configuration
iansf 2015/06/09 01:52:05 I wonder if the validation should be done in a pla
viettrungluu 2015/06/09 22:18:07 The other possibility (or maybe even requirement)
iansf 2015/06/09 22:29:06 Do you have a suggestion for how that would look?
if (is_headless_)
platform_viewport_ = PlatformViewportHeadless::Create(this);
else

Powered by Google App Engine
This is Rietveld 408576698