Commit d6d48af9 authored by Khushal's avatar Khushal Committed by Commit Bot

vr/android: Disable SurfaceControl when in VR mode.

The android surface used by the display compositor when in VR mode is
backed by SurfaceTexture, which is incompatible for use with
SurfaceControl. Disable it when in VR mode.

Fundamentally, SurfaceControl can only be used when the consumer end
of the display's frame updates is SurfaceFlinger. With SurfaceTexture,
the consumer end can be any arbitrary process which created the
SurfaceTexture.

TBR=tsepez@chromium.org
R=piman@chromium.org

Bug: 953953
Change-Id: Ie132d143aeffcf1bb022f6c691a0738515b19a1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1573164
Commit-Queue: Khushal <khushalsagar@chromium.org>
Reviewed-by: default avatarMichael Thiessen <mthiesse@chromium.org>
Reviewed-by: default avatarEric Karl <ericrk@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652288}
parent c0726120
...@@ -306,7 +306,9 @@ public class CompositorView ...@@ -306,7 +306,9 @@ public class CompositorView
public void surfaceChanged(Surface surface, int format, int width, int height) { public void surfaceChanged(Surface surface, int format, int width, int height) {
if (mNativeCompositorView == 0) return; if (mNativeCompositorView == 0) return;
nativeSurfaceChanged(mNativeCompositorView, format, width, height, surface); boolean backedBySurfaceTexture = mIsInVr;
nativeSurfaceChanged(
mNativeCompositorView, format, width, height, backedBySurfaceTexture, surface);
mRenderHost.onSurfaceResized(width, height); mRenderHost.onSurfaceResized(width, height);
} }
...@@ -518,8 +520,8 @@ public class CompositorView ...@@ -518,8 +520,8 @@ public class CompositorView
private native ResourceManager nativeGetResourceManager(long nativeCompositorView); private native ResourceManager nativeGetResourceManager(long nativeCompositorView);
private native void nativeSurfaceCreated(long nativeCompositorView); private native void nativeSurfaceCreated(long nativeCompositorView);
private native void nativeSurfaceDestroyed(long nativeCompositorView); private native void nativeSurfaceDestroyed(long nativeCompositorView);
private native void nativeSurfaceChanged( private native void nativeSurfaceChanged(long nativeCompositorView, int format, int width,
long nativeCompositorView, int format, int width, int height, Surface surface); int height, boolean backedBySurfaceTexture, Surface surface);
private native void nativeOnPhysicalBackingSizeChanged( private native void nativeOnPhysicalBackingSizeChanged(
long nativeCompositorView, WebContents webContents, int width, int height); long nativeCompositorView, WebContents webContents, int width, int height);
private native void nativeFinalizeLayers(long nativeCompositorView); private native void nativeFinalizeLayers(long nativeCompositorView);
......
...@@ -124,7 +124,7 @@ base::android::ScopedJavaLocalRef<jobject> CompositorView::GetResourceManager( ...@@ -124,7 +124,7 @@ base::android::ScopedJavaLocalRef<jobject> CompositorView::GetResourceManager(
void CompositorView::RecreateSurface() { void CompositorView::RecreateSurface() {
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
compositor_->SetSurface(nullptr); compositor_->SetSurface(nullptr, false);
Java_CompositorView_recreateSurface(env, obj_); Java_CompositorView_recreateSurface(env, obj_);
} }
...@@ -167,7 +167,7 @@ void CompositorView::SurfaceCreated(JNIEnv* env, ...@@ -167,7 +167,7 @@ void CompositorView::SurfaceCreated(JNIEnv* env,
void CompositorView::SurfaceDestroyed(JNIEnv* env, void CompositorView::SurfaceDestroyed(JNIEnv* env,
const JavaParamRef<jobject>& object) { const JavaParamRef<jobject>& object) {
compositor_->SetSurface(nullptr); compositor_->SetSurface(nullptr, false);
current_surface_format_ = 0; current_surface_format_ = 0;
tab_content_manager_->OnUIResourcesWereEvicted(); tab_content_manager_->OnUIResourcesWereEvicted();
} }
...@@ -177,11 +177,12 @@ void CompositorView::SurfaceChanged(JNIEnv* env, ...@@ -177,11 +177,12 @@ void CompositorView::SurfaceChanged(JNIEnv* env,
jint format, jint format,
jint width, jint width,
jint height, jint height,
bool backed_by_surface_texture,
const JavaParamRef<jobject>& surface) { const JavaParamRef<jobject>& surface) {
DCHECK(surface); DCHECK(surface);
if (current_surface_format_ != format) { if (current_surface_format_ != format) {
current_surface_format_ = format; current_surface_format_ = format;
compositor_->SetSurface(surface); compositor_->SetSurface(surface, backed_by_surface_texture);
} }
gfx::Size size = gfx::Size(width, height); gfx::Size size = gfx::Size(width, height);
compositor_->SetWindowBounds(size); compositor_->SetWindowBounds(size);
...@@ -281,7 +282,7 @@ void CompositorView::BrowserChildProcessKilled( ...@@ -281,7 +282,7 @@ void CompositorView::BrowserChildProcessKilled(
base::android::SDK_VERSION_JELLY_BEAN_MR2 && base::android::SDK_VERSION_JELLY_BEAN_MR2 &&
data.process_type == content::PROCESS_TYPE_GPU) { data.process_type == content::PROCESS_TYPE_GPU) {
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
compositor_->SetSurface(nullptr); compositor_->SetSurface(nullptr, false);
Java_CompositorView_recreateSurface(env, obj_); Java_CompositorView_recreateSurface(env, obj_);
} }
} }
......
...@@ -68,6 +68,7 @@ class CompositorView : public content::CompositorClient, ...@@ -68,6 +68,7 @@ class CompositorView : public content::CompositorClient,
jint format, jint format,
jint width, jint width,
jint height, jint height,
bool backed_by_surface_texture,
const base::android::JavaParamRef<jobject>& surface); const base::android::JavaParamRef<jobject>& surface);
void OnPhysicalBackingSizeChanged( void OnPhysicalBackingSizeChanged(
JNIEnv* env, JNIEnv* env,
......
...@@ -85,7 +85,7 @@ void ContentViewRenderView::SurfaceCreated(JNIEnv* env, ...@@ -85,7 +85,7 @@ void ContentViewRenderView::SurfaceCreated(JNIEnv* env,
void ContentViewRenderView::SurfaceDestroyed(JNIEnv* env, void ContentViewRenderView::SurfaceDestroyed(JNIEnv* env,
const JavaParamRef<jobject>& obj) { const JavaParamRef<jobject>& obj) {
compositor_->SetSurface(NULL); compositor_->SetSurface(nullptr, false);
current_surface_format_ = 0; current_surface_format_ = 0;
} }
...@@ -98,7 +98,7 @@ void ContentViewRenderView::SurfaceChanged( ...@@ -98,7 +98,7 @@ void ContentViewRenderView::SurfaceChanged(
const JavaParamRef<jobject>& surface) { const JavaParamRef<jobject>& surface) {
if (current_surface_format_ != format) { if (current_surface_format_ != format) {
current_surface_format_ = format; current_surface_format_ = format;
compositor_->SetSurface(surface); compositor_->SetSurface(surface, false /* backed_by_surface_texture */);
} }
compositor_->SetWindowBounds(gfx::Size(width, height)); compositor_->SetWindowBounds(gfx::Size(width, height));
} }
......
...@@ -51,6 +51,7 @@ class VIZ_COMMON_EXPORT RendererSettings { ...@@ -51,6 +51,7 @@ class VIZ_COMMON_EXPORT RendererSettings {
gfx::Size initial_screen_size = gfx::Size(0, 0); gfx::Size initial_screen_size = gfx::Size(0, 0);
gfx::ColorSpace color_space; gfx::ColorSpace color_space;
bool backed_by_surface_texture = false;
#endif #endif
#if defined(USE_OZONE) #if defined(USE_OZONE)
......
...@@ -10,10 +10,14 @@ namespace viz { ...@@ -10,10 +10,14 @@ namespace viz {
GLOutputSurfaceAndroid::GLOutputSurfaceAndroid( GLOutputSurfaceAndroid::GLOutputSurfaceAndroid(
scoped_refptr<VizProcessContextProvider> context_provider, scoped_refptr<VizProcessContextProvider> context_provider,
UpdateVSyncParametersCallback update_vsync_callback) UpdateVSyncParametersCallback update_vsync_callback,
: GLOutputSurface(context_provider, std::move(update_vsync_callback)), bool allow_overlays)
overlay_candidate_validator_( : GLOutputSurface(context_provider, std::move(update_vsync_callback)) {
std::make_unique<CompositorOverlayCandidateValidatorAndroid>()) {} if (allow_overlays) {
overlay_candidate_validator_ =
std::make_unique<CompositorOverlayCandidateValidatorAndroid>();
}
}
GLOutputSurfaceAndroid::~GLOutputSurfaceAndroid() = default; GLOutputSurfaceAndroid::~GLOutputSurfaceAndroid() = default;
......
...@@ -16,7 +16,8 @@ class GLOutputSurfaceAndroid : public GLOutputSurface { ...@@ -16,7 +16,8 @@ class GLOutputSurfaceAndroid : public GLOutputSurface {
public: public:
GLOutputSurfaceAndroid( GLOutputSurfaceAndroid(
scoped_refptr<VizProcessContextProvider> context_provider, scoped_refptr<VizProcessContextProvider> context_provider,
UpdateVSyncParametersCallback update_vsync_callback); UpdateVSyncParametersCallback update_vsync_callback,
bool allow_overlays);
~GLOutputSurfaceAndroid() override; ~GLOutputSurfaceAndroid() override;
// GLOutputSurface implementation: // GLOutputSurface implementation:
......
...@@ -238,8 +238,16 @@ std::unique_ptr<Display> GpuDisplayProvider::CreateDisplay( ...@@ -238,8 +238,16 @@ std::unique_ptr<Display> GpuDisplayProvider::CreateDisplay(
std::move(context_provider), std::move(update_vsync_callback), std::move(context_provider), std::move(update_vsync_callback),
use_overlays); use_overlays);
#elif defined(OS_ANDROID) #elif defined(OS_ANDROID)
const bool surface_control_enabled =
task_executor_->gpu_feature_info()
.status_values[gpu::GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] ==
gpu::kGpuFeatureStatusEnabled;
DCHECK(!surface_control_enabled ||
renderer_settings.backed_by_surface_texture);
output_surface = std::make_unique<GLOutputSurfaceAndroid>( output_surface = std::make_unique<GLOutputSurfaceAndroid>(
std::move(context_provider), std::move(update_vsync_callback)); std::move(context_provider), std::move(update_vsync_callback),
!surface_control_enabled /* allow_overlays */);
#else #else
output_surface = std::make_unique<GLOutputSurface>( output_surface = std::make_unique<GLOutputSurface>(
std::move(context_provider), std::move(update_vsync_callback)); std::move(context_provider), std::move(update_vsync_callback));
......
...@@ -44,7 +44,7 @@ namespace { ...@@ -44,7 +44,7 @@ namespace {
gpu::ContextCreationAttribs CreateAttributes( gpu::ContextCreationAttribs CreateAttributes(
bool requires_alpha_channel, bool requires_alpha_channel,
const gfx::ColorSpace& color_space) { const RendererSettings& renderer_settings) {
gpu::ContextCreationAttribs attributes; gpu::ContextCreationAttribs attributes;
attributes.alpha_size = requires_alpha_channel ? 8 : -1; attributes.alpha_size = requires_alpha_channel ? 8 : -1;
attributes.depth_size = 0; attributes.depth_size = 0;
...@@ -65,9 +65,10 @@ gpu::ContextCreationAttribs CreateAttributes( ...@@ -65,9 +65,10 @@ gpu::ContextCreationAttribs CreateAttributes(
attributes.lose_context_when_out_of_memory = true; attributes.lose_context_when_out_of_memory = true;
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
if (color_space == gfx::ColorSpace::CreateSRGB()) { if (renderer_settings.color_space == gfx::ColorSpace::CreateSRGB()) {
attributes.color_space = gpu::COLOR_SPACE_SRGB; attributes.color_space = gpu::COLOR_SPACE_SRGB;
} else if (color_space == gfx::ColorSpace::CreateDisplayP3D65()) { } else if (renderer_settings.color_space ==
gfx::ColorSpace::CreateDisplayP3D65()) {
attributes.color_space = gpu::COLOR_SPACE_DISPLAY_P3; attributes.color_space = gpu::COLOR_SPACE_DISPLAY_P3;
} else { } else {
// The browser only sends the above two color spaces. // The browser only sends the above two color spaces.
...@@ -84,6 +85,8 @@ gpu::ContextCreationAttribs CreateAttributes( ...@@ -84,6 +85,8 @@ gpu::ContextCreationAttribs CreateAttributes(
} }
attributes.enable_swap_timestamps_if_supported = true; attributes.enable_swap_timestamps_if_supported = true;
attributes.backed_by_surface_texture =
renderer_settings.backed_by_surface_texture;
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
return attributes; return attributes;
...@@ -93,15 +96,6 @@ void UmaRecordContextLost(ContextLostReason reason) { ...@@ -93,15 +96,6 @@ void UmaRecordContextLost(ContextLostReason reason) {
UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.DisplayCompositor", reason); UMA_HISTOGRAM_ENUMERATION("GPU.ContextLost.DisplayCompositor", reason);
} }
gfx::ColorSpace ColorSpaceForRendererSettings(
const RendererSettings& renderer_settings) {
#if defined(OS_ANDROID)
return renderer_settings.color_space;
#else
return gfx::ColorSpace();
#endif
}
gpu::SharedMemoryLimits SharedMemoryLimitsForRendererSettings( gpu::SharedMemoryLimits SharedMemoryLimitsForRendererSettings(
const RendererSettings& renderer_settings) { const RendererSettings& renderer_settings) {
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
...@@ -121,9 +115,8 @@ VizProcessContextProvider::VizProcessContextProvider( ...@@ -121,9 +115,8 @@ VizProcessContextProvider::VizProcessContextProvider(
gpu::ImageFactory* image_factory, gpu::ImageFactory* image_factory,
gpu::GpuChannelManagerDelegate* gpu_channel_manager_delegate, gpu::GpuChannelManagerDelegate* gpu_channel_manager_delegate,
const RendererSettings& renderer_settings) const RendererSettings& renderer_settings)
: attributes_( : attributes_(CreateAttributes(renderer_settings.requires_alpha_channel,
CreateAttributes(renderer_settings.requires_alpha_channel, renderer_settings)) {
ColorSpaceForRendererSettings(renderer_settings))) {
InitializeContext(std::move(task_executor), surface_handle, InitializeContext(std::move(task_executor), surface_handle,
gpu_memory_buffer_manager, image_factory, gpu_memory_buffer_manager, image_factory,
gpu_channel_manager_delegate, gpu_channel_manager_delegate,
......
...@@ -617,7 +617,7 @@ CompositorImpl::~CompositorImpl() { ...@@ -617,7 +617,7 @@ CompositorImpl::~CompositorImpl() {
display::Screen::GetScreen()->RemoveObserver(this); display::Screen::GetScreen()->RemoveObserver(this);
DetachRootWindow(); DetachRootWindow();
// Clean-up any surface references. // Clean-up any surface references.
SetSurface(NULL); SetSurface(nullptr, false);
} }
void CompositorImpl::DetachRootWindow() { void CompositorImpl::DetachRootWindow() {
...@@ -682,7 +682,8 @@ void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { ...@@ -682,7 +682,8 @@ void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) {
} }
} }
void CompositorImpl::SetSurface(jobject surface) { void CompositorImpl::SetSurface(jobject surface,
bool backed_by_surface_texture) {
JNIEnv* env = base::android::AttachCurrentThread(); JNIEnv* env = base::android::AttachCurrentThread();
gpu::GpuSurfaceTracker* tracker = gpu::GpuSurfaceTracker::Get(); gpu::GpuSurfaceTracker* tracker = gpu::GpuSurfaceTracker::Get();
...@@ -693,6 +694,7 @@ void CompositorImpl::SetSurface(jobject surface) { ...@@ -693,6 +694,7 @@ void CompositorImpl::SetSurface(jobject surface) {
ANativeWindow_release(window_); ANativeWindow_release(window_);
window_ = NULL; window_ = NULL;
surface_handle_ = gpu::kNullSurfaceHandle; surface_handle_ = gpu::kNullSurfaceHandle;
backed_by_surface_texture_ = false;
} }
ANativeWindow* window = NULL; ANativeWindow* window = NULL;
...@@ -706,6 +708,7 @@ void CompositorImpl::SetSurface(jobject surface) { ...@@ -706,6 +708,7 @@ void CompositorImpl::SetSurface(jobject surface) {
if (window) { if (window) {
window_ = window; window_ = window;
backed_by_surface_texture_ = backed_by_surface_texture;
ANativeWindow_acquire(window); ANativeWindow_acquire(window);
// Register first, SetVisible() might create a LayerTreeFrameSink. // Register first, SetVisible() might create a LayerTreeFrameSink.
surface_handle_ = tracker->AddSurfaceForNativeWidget( surface_handle_ = tracker->AddSurfaceForNativeWidget(
...@@ -1223,6 +1226,8 @@ void CompositorImpl::InitializeVizLayerTreeFrameSink( ...@@ -1223,6 +1226,8 @@ void CompositorImpl::InitializeVizLayerTreeFrameSink(
.GetSizeInPixel(); .GetSizeInPixel();
renderer_settings.use_skia_renderer = features::IsUsingSkiaRenderer(); renderer_settings.use_skia_renderer = features::IsUsingSkiaRenderer();
renderer_settings.color_space = display_color_space_; renderer_settings.color_space = display_color_space_;
renderer_settings.backed_by_surface_texture = backed_by_surface_texture_;
root_params->frame_sink_id = frame_sink_id_; root_params->frame_sink_id = frame_sink_id_;
root_params->widget = surface_handle_; root_params->widget = surface_handle_;
root_params->gpu_compositing = true; root_params->gpu_compositing = true;
...@@ -1273,7 +1278,7 @@ void CompositorImpl::OnFatalOrSurfaceContextCreationFailure( ...@@ -1273,7 +1278,7 @@ void CompositorImpl::OnFatalOrSurfaceContextCreationFailure(
<< "Fatal error making Gpu context"; << "Fatal error making Gpu context";
if (context_result == gpu::ContextResult::kSurfaceFailure) { if (context_result == gpu::ContextResult::kSurfaceFailure) {
SetSurface(nullptr); SetSurface(nullptr, false);
client_->RecreateSurface(); client_->RecreateSurface();
} }
} }
......
...@@ -100,7 +100,7 @@ class CONTENT_EXPORT CompositorImpl ...@@ -100,7 +100,7 @@ class CONTENT_EXPORT CompositorImpl
// Compositor implementation. // Compositor implementation.
void SetRootWindow(gfx::NativeWindow root_window) override; void SetRootWindow(gfx::NativeWindow root_window) override;
void SetRootLayer(scoped_refptr<cc::Layer> root) override; void SetRootLayer(scoped_refptr<cc::Layer> root) override;
void SetSurface(jobject surface) override; void SetSurface(jobject surface, bool backed_by_surface_texture) override;
void SetBackgroundColor(int color) override; void SetBackgroundColor(int color) override;
void SetWindowBounds(const gfx::Size& size) override; void SetWindowBounds(const gfx::Size& size) override;
void SetRequiresAlphaChannel(bool flag) override; void SetRequiresAlphaChannel(bool flag) override;
...@@ -231,6 +231,7 @@ class CONTENT_EXPORT CompositorImpl ...@@ -231,6 +231,7 @@ class CONTENT_EXPORT CompositorImpl
ANativeWindow* window_; ANativeWindow* window_;
gpu::SurfaceHandle surface_handle_; gpu::SurfaceHandle surface_handle_;
bool backed_by_surface_texture_ = false;
CompositorClient* client_; CompositorClient* client_;
......
...@@ -68,7 +68,7 @@ class CONTENT_EXPORT Compositor { ...@@ -68,7 +68,7 @@ class CONTENT_EXPORT Compositor {
virtual void SetWindowBounds(const gfx::Size& size) = 0; virtual void SetWindowBounds(const gfx::Size& size) = 0;
// Set the output surface which the compositor renders into. // Set the output surface which the compositor renders into.
virtual void SetSurface(jobject surface) = 0; virtual void SetSurface(jobject surface, bool backed_by_surface_texture) = 0;
// Set the background color used by the layer tree host. // Set the background color used by the layer tree host.
virtual void SetBackgroundColor(int color) = 0; virtual void SetBackgroundColor(int color) = 0;
......
...@@ -65,6 +65,7 @@ struct GPU_EXPORT ContextCreationAttribs { ...@@ -65,6 +65,7 @@ struct GPU_EXPORT ContextCreationAttribs {
bool enable_raster_interface = false; bool enable_raster_interface = false;
bool enable_oop_rasterization = false; bool enable_oop_rasterization = false;
bool enable_swap_timestamps_if_supported = false; bool enable_swap_timestamps_if_supported = false;
bool backed_by_surface_texture = false;
ContextType context_type = CONTEXT_TYPE_OPENGLES2; ContextType context_type = CONTEXT_TYPE_OPENGLES2;
ColorSpace color_space = COLOR_SPACE_UNSPECIFIED; ColorSpace color_space = COLOR_SPACE_UNSPECIFIED;
......
...@@ -195,6 +195,7 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::ContextCreationAttribs) ...@@ -195,6 +195,7 @@ IPC_STRUCT_TRAITS_BEGIN(gpu::ContextCreationAttribs)
IPC_STRUCT_TRAITS_MEMBER(enable_raster_interface) IPC_STRUCT_TRAITS_MEMBER(enable_raster_interface)
IPC_STRUCT_TRAITS_MEMBER(enable_oop_rasterization) IPC_STRUCT_TRAITS_MEMBER(enable_oop_rasterization)
IPC_STRUCT_TRAITS_MEMBER(enable_swap_timestamps_if_supported) IPC_STRUCT_TRAITS_MEMBER(enable_swap_timestamps_if_supported)
IPC_STRUCT_TRAITS_MEMBER(backed_by_surface_texture)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(gpu::GpuMemoryBufferFormatSet) IPC_STRUCT_TRAITS_BEGIN(gpu::GpuMemoryBufferFormatSet)
......
...@@ -419,8 +419,13 @@ gpu::ContextResult InProcessCommandBuffer::InitializeOnGpuThread( ...@@ -419,8 +419,13 @@ gpu::ContextResult InProcessCommandBuffer::InitializeOnGpuThread(
base::ThreadTaskRunnerHandle::Get()); base::ThreadTaskRunnerHandle::Get());
} }
auto feature_info = base::MakeRefCounted<gles2::FeatureInfo>( gpu::GpuFeatureInfo gpu_feature_info = task_executor_->gpu_feature_info();
workarounds, task_executor_->gpu_feature_info()); if (params.attribs.backed_by_surface_texture) {
gpu_feature_info.status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
kGpuFeatureStatusDisabled;
}
auto feature_info =
base::MakeRefCounted<gles2::FeatureInfo>(workarounds, gpu_feature_info);
context_group_ = base::MakeRefCounted<gles2::ContextGroup>( context_group_ = base::MakeRefCounted<gles2::ContextGroup>(
task_executor_->gpu_preferences(), task_executor_->gpu_preferences(),
gles2::PassthroughCommandDecoderSupported(), gles2::PassthroughCommandDecoderSupported(),
......
...@@ -32,6 +32,9 @@ struct RendererSettings { ...@@ -32,6 +32,9 @@ struct RendererSettings {
[EnableIf=is_android] [EnableIf=is_android]
gfx.mojom.ColorSpace color_space; gfx.mojom.ColorSpace color_space;
[EnableIf=is_android]
bool backed_by_surface_texture;
[EnableIf=use_ozone] [EnableIf=use_ozone]
array<OverlayStrategy> overlay_strategies; array<OverlayStrategy> overlay_strategies;
}; };
...@@ -41,6 +41,8 @@ bool StructTraits<viz::mojom::RendererSettingsDataView, viz::RendererSettings>:: ...@@ -41,6 +41,8 @@ bool StructTraits<viz::mojom::RendererSettingsDataView, viz::RendererSettings>::
if (!data.ReadColorSpace(&out->color_space)) if (!data.ReadColorSpace(&out->color_space))
return false; return false;
out->backed_by_surface_texture = data.backed_by_surface_texture();
#endif #endif
#if defined(USE_OZONE) #if defined(USE_OZONE)
......
...@@ -95,6 +95,10 @@ struct StructTraits<viz::mojom::RendererSettingsDataView, ...@@ -95,6 +95,10 @@ struct StructTraits<viz::mojom::RendererSettingsDataView,
static gfx::ColorSpace color_space(const viz::RendererSettings& input) { static gfx::ColorSpace color_space(const viz::RendererSettings& input) {
return input.color_space; return input.color_space;
} }
static bool backed_by_surface_texture(const viz::RendererSettings& input) {
return input.backed_by_surface_texture;
}
#endif #endif
#if defined(USE_OZONE) #if defined(USE_OZONE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment