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

Unified Diff: content/common/gpu/client/gl_helper.h

Issue 149123008: Implement GLHelperReadbackSupport for GLHelper usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted cl using git format option. Created 6 years, 10 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: content/common/gpu/client/gl_helper.h
diff --git a/content/common/gpu/client/gl_helper.h b/content/common/gpu/client/gl_helper.h
index 46db753207217ae13659920803008f68b739df8c..daf8ad93327fc5a1ab3e0e9ffccf032fbddaee3d 100644
--- a/content/common/gpu/client/gl_helper.h
+++ b/content/common/gpu/client/gl_helper.h
@@ -169,6 +169,12 @@ class CONTENT_EXPORT GLHelper {
SCALER_QUALITY_BEST = 3,
};
+ enum FormatSupport {
+ FORMAT_NOT_SUPPORTED = 0,
+ FORMAT_SUPPORTED,
+ FORMAT_NONE,
no sievers 2014/02/19 19:09:39 nit: FORMAT_NONE -> FORMAT_SUPPORT_UNKNOWN
sivag 2014/02/21 11:40:51 Done.
+ };
+
// Copies the block of pixels specified with |src_subrect| from |src_texture|,
// scales it to |dst_size|, and writes it into |out|.
// |src_size| is the size of |src_texture|. The result is of format GL_BGRA
@@ -277,8 +283,9 @@ class CONTENT_EXPORT GLHelper {
// size of the framebuffer.
void CopyTextureFullImage(GLuint texture, const gfx::Size& size);
- // Check whether rgb565 readback is supported or not.
- bool CanUseRgb565Readback();
+ // Checks whether the readback using passed texture format
+ // is supported or not.
no sievers 2014/02/19 19:09:39 nit: I think the comment could still be a bit clea
sivag 2014/02/21 11:40:51 Done.
+ bool IsReadBackConfigSupported(const SkBitmap::Config& bitmap_format);
// A scaler will cache all intermediate textures and programs
// needed to scale from a specified size to a destination size.
@@ -328,6 +335,10 @@ class CONTENT_EXPORT GLHelper {
// 0 if GL_EXT_draw_buffers is not available.
GLint MaxDrawBuffers();
+ private:
+ // Helper functions for checking the supported texture formats.
+ bool SupportsFormat(GLint format, GLint type);
+
protected:
class CopyTextureToImpl;
@@ -340,8 +351,7 @@ class CONTENT_EXPORT GLHelper {
gpu::ContextSupport* context_support_;
scoped_ptr<CopyTextureToImpl> copy_texture_to_impl_;
scoped_ptr<GLHelperScaling> scaler_impl_;
- bool initialized_565_format_check_;
- bool support_565_format_;
+ FormatSupport format_support_table_[SkBitmap::kConfigCount];
DISALLOW_COPY_AND_ASSIGN(GLHelper);
};

Powered by Google App Engine
This is Rietveld 408576698