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

Unified Diff: ui/ozone/demo/surfaceless_gl_renderer.cc

Issue 2213273002: ozone: Consolidate primary plane format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment on a single line. Created 4 years, 4 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 | « ui/display/types/display_snapshot.cc ('k') | ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/demo/surfaceless_gl_renderer.cc
diff --git a/ui/ozone/demo/surfaceless_gl_renderer.cc b/ui/ozone/demo/surfaceless_gl_renderer.cc
index f7d6b8f5c5d4b36b6598950dc89650d45a616610..f1e5792f11a8e9da0a9245982fb7f4864d04299c 100644
--- a/ui/ozone/demo/surfaceless_gl_renderer.cc
+++ b/ui/ozone/demo/surfaceless_gl_renderer.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/macros.h"
#include "base/trace_event/trace_event.h"
+#include "ui/display/types/display_snapshot.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_image.h"
@@ -39,14 +40,14 @@ bool SurfacelessGlRenderer::BufferWrapper::Initialize(
glGenFramebuffersEXT(1, &gl_fb_);
glGenTextures(1, &gl_tex_);
+ gfx::BufferFormat format = ui::DisplaySnapshot::PrimaryFormat();
scoped_refptr<NativePixmap> pixmap =
OzonePlatform::GetInstance()
->GetSurfaceFactoryOzone()
- ->CreateNativePixmap(widget, size, gfx::BufferFormat::BGRX_8888,
- gfx::BufferUsage::SCANOUT);
+ ->CreateNativePixmap(widget, size, format, gfx::BufferUsage::SCANOUT);
scoped_refptr<ui::GLImageOzoneNativePixmap> image(
new ui::GLImageOzoneNativePixmap(size, GL_RGB));
- if (!image->Initialize(pixmap.get(), gfx::BufferFormat::BGRX_8888)) {
+ if (!image->Initialize(pixmap.get(), format)) {
LOG(ERROR) << "Failed to create GLImage";
return false;
}
« no previous file with comments | « ui/display/types/display_snapshot.cc ('k') | ui/ozone/platform/drm/client_native_pixmap_factory_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698