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

Unified Diff: cc/resources/resource_provider.h

Issue 2748903002: cc: Add gfx::BufferFormat to cc::ResourceProvider::Resource. (Closed)
Patch Set: Always initialize buffer_format. Created 3 years, 9 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 | « cc/output/overlay_candidate.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index 89836b957fea94a47c61ec2b4b01dae560ba5c02..626eee84619552012f3653d0484ddd5fcbae936b 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -38,6 +38,7 @@
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/buffer_types.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gpu_memory_buffer.h"
@@ -488,6 +489,9 @@ class CC_EXPORT ResourceProvider
// Indicates if this resource may be used for a hardware overlay plane.
bool IsOverlayCandidate(ResourceId id);
+ // Return the format of the underlying buffer that can be used for scanout.
+ gfx::BufferFormat GetBufferFormat(ResourceId id);
+
#if defined(OS_ANDROID)
// Indicates if this resource is backed by an Android SurfaceTexture, and thus
// can't really be promoted to an overlay.
@@ -632,6 +636,13 @@ class CC_EXPORT ResourceProvider
// GpuMemoryBuffer resource allocation needs to know how the resource will
// be used.
gfx::BufferUsage usage;
+ // This is the the actual format of the underlaying GpuMemoryBuffer, if any,
+ // and might not correspond to ResourceFormat. This format is needed to
+ // scanout the buffer as HW overlay.
+ gfx::BufferFormat buffer_format;
+ // Resource format is the format as seen from the compositor and might not
+ // correspond to buffer_format (e.g: A resouce that was created from a YUV
+ // buffer could be seen as RGB from the compositor/GL.)
ResourceFormat format;
SharedBitmapId shared_bitmap_id;
SharedBitmap* shared_bitmap;
« no previous file with comments | « cc/output/overlay_candidate.cc ('k') | cc/resources/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698