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); |
}; |