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

Unified Diff: ui/gl/gl_surface_ozone.cc

Issue 1513283002: Add support to send optimal format as part of ScheduleOverlayPlane (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update cmd_buffer_functions Created 5 years 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 | « ui/gl/gl_surface_overlay.cc ('k') | ui/ozone/demo/surfaceless_gl_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_ozone.cc
diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
index b2dc8df466f5bf830247d2a2606ea883d19be6ff..2b749932f20ce9bc64796cf4faea632c0ae0de1a 100644
--- a/ui/gl/gl_surface_ozone.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -51,9 +51,11 @@ class GL_EXPORT GLSurfaceOzoneEGL : public NativeViewGLSurfaceEGL {
gfx::SwapResult SwapBuffers() override;
bool ScheduleOverlayPlane(int z_order,
OverlayTransform transform,
+ gfx::BufferFormat storage_format,
GLImage* image,
const Rect& bounds_rect,
- const RectF& crop_rect) override;
+ const RectF& crop_rect,
+ bool handle_scaling) override;
private:
using NativeViewGLSurfaceEGL::Initialize;
@@ -101,11 +103,14 @@ gfx::SwapResult GLSurfaceOzoneEGL::SwapBuffers() {
bool GLSurfaceOzoneEGL::ScheduleOverlayPlane(int z_order,
OverlayTransform transform,
+ gfx::BufferFormat storage_format,
GLImage* image,
const Rect& bounds_rect,
- const RectF& crop_rect) {
- return image->ScheduleOverlayPlane(widget_, z_order, transform, bounds_rect,
- crop_rect);
+ const RectF& crop_rect,
+ bool handle_scaling) {
+ return image->ScheduleOverlayPlane(widget_, z_order, transform,
+ storage_format, bounds_rect,
+ crop_rect, handle_scaling);
}
GLSurfaceOzoneEGL::~GLSurfaceOzoneEGL() {
@@ -149,9 +154,11 @@ class GL_EXPORT GLSurfaceOzoneSurfaceless : public SurfacelessEGL {
gfx::SwapResult SwapBuffers() override;
bool ScheduleOverlayPlane(int z_order,
OverlayTransform transform,
+ gfx::BufferFormat storage_format,
GLImage* image,
const Rect& bounds_rect,
- const RectF& crop_rect) override;
+ const RectF& crop_rect,
+ bool handle_scaling) override;
bool IsOffscreen() override;
VSyncProvider* GetVSyncProvider() override;
bool SupportsAsyncSwap() override;
@@ -263,13 +270,14 @@ gfx::SwapResult GLSurfaceOzoneSurfaceless::SwapBuffers() {
: gfx::SwapResult::SWAP_FAILED;
}
-bool GLSurfaceOzoneSurfaceless::ScheduleOverlayPlane(int z_order,
- OverlayTransform transform,
- GLImage* image,
- const Rect& bounds_rect,
- const RectF& crop_rect) {
+bool GLSurfaceOzoneSurfaceless::ScheduleOverlayPlane(
+ int z_order, OverlayTransform transform,
+ gfx::BufferFormat storage_format, GLImage* image,
+ const Rect& bounds_rect, const RectF& crop_rect,
+ bool handle_scaling) {
unsubmitted_frames_.back()->overlays.push_back(
- GLSurfaceOverlay(z_order, transform, image, bounds_rect, crop_rect));
+ GLSurfaceOverlay(z_order, transform, storage_format, image, bounds_rect,
+ crop_rect, handle_scaling));
return true;
}
@@ -484,8 +492,10 @@ bool GLSurfaceOzoneSurfacelessSurfaceImpl::SupportsPostSubBuffer() {
gfx::SwapResult GLSurfaceOzoneSurfacelessSurfaceImpl::SwapBuffers() {
if (!images_[current_surface_]->ScheduleOverlayPlane(
widget_, 0, OverlayTransform::OVERLAY_TRANSFORM_NONE,
- gfx::Rect(GetSize()), gfx::RectF(1, 1)))
+ gfx::BufferFormat::BGRX_8888, gfx::Rect(GetSize()),
+ gfx::RectF(1, 1), true)) {
return gfx::SwapResult::SWAP_FAILED;
+ }
gfx::SwapResult result = GLSurfaceOzoneSurfaceless::SwapBuffers();
if (result != gfx::SwapResult::SWAP_ACK)
return result;
@@ -498,7 +508,8 @@ void GLSurfaceOzoneSurfacelessSurfaceImpl::SwapBuffersAsync(
const SwapCompletionCallback& callback) {
if (!images_[current_surface_]->ScheduleOverlayPlane(
widget_, 0, OverlayTransform::OVERLAY_TRANSFORM_NONE,
- gfx::Rect(GetSize()), gfx::RectF(1, 1))) {
+ gfx::BufferFormat::BGRX_8888, gfx::Rect(GetSize()),
+ gfx::RectF(1, 1), true)) {
callback.Run(gfx::SwapResult::SWAP_FAILED);
return;
}
« no previous file with comments | « ui/gl/gl_surface_overlay.cc ('k') | ui/ozone/demo/surfaceless_gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698