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

Unified Diff: src/gpu/gl/GrGLCaps.h

Issue 1542813004: Move read pixels format info into ConifgInfo in GrGLCaps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup 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 | « no previous file | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.h
diff --git a/src/gpu/gl/GrGLCaps.h b/src/gpu/gl/GrGLCaps.h
index f32684e23cf1259a374427622e3cb6d0070f2863..230bffc7a657cbbceee01801830768f46f08199e 100644
--- a/src/gpu/gl/GrGLCaps.h
+++ b/src/gpu/gl/GrGLCaps.h
@@ -285,9 +285,8 @@ public:
/// Does ReadPixels support the provided format/type combo?
bool readPixelsSupported(const GrGLInterface* intf,
- GrGLenum format,
- GrGLenum type,
- GrGLenum currFboFormat) const;
+ GrPixelConfig readConfig,
+ GrPixelConfig currFBOConfig) const;
bool isCoreProfile() const { return fIsCoreProfile; }
@@ -342,8 +341,6 @@ private:
void initConfigRenderableTable(const GrGLContextInfo&, bool srgbSupport);
void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*, bool srgbSupport);
- bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLenum type) const;
-
void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo,
const GrGLInterface* intf,
GrGLSLCaps* glslCaps);
@@ -374,7 +371,6 @@ private:
bool fTexStorageSupport : 1;
bool fTextureRedSupport : 1;
bool fImagingSupport : 1;
- bool fTwoFormatLimit : 1;
bool fVertexArrayObjectSupport : 1;
bool fDirectStateAccessSupport : 1;
bool fDebugSupport : 1;
@@ -389,11 +385,30 @@ private:
bool fBindUniformLocationSupport : 1;
bool fExternalTextureSupport : 1;
+ /** Number type of the components (with out considering number of bits.) */
+ enum FormatType {
+ kNormalizedFixedPoint_FormatType,
+ kFloat_FormatType,
+ };
+
+ struct ReadPixelsFormat {
+ ReadPixelsFormat() : fFormat(0), fType(0) {}
+ GrGLenum fFormat;
+ GrGLenum fType;
+ };
+
struct ConfigInfo {
- ConfigInfo() : fStencilFormatIndex(kUnknown_StencilIndex), fFlags(0) {};
+ ConfigInfo() : fStencilFormatIndex(kUnknown_StencilIndex), fFlags(0) {}
ConfigFormats fFormats;
+ FormatType fFormatType;
+
+ // On ES contexts there are restrictions on type type/format that may be used for
+ // ReadPixels. One is implicitly specified by the current FBO's format. The other is
+ // queryable. This stores the queried option (lazily).
+ ReadPixelsFormat fSecondReadPixelsFormat;
+
enum {
// This indicates that a stencil format has not yet been determined for the config.
kUnknown_StencilIndex = -1,
@@ -412,19 +427,6 @@ private:
ConfigInfo fConfigTable[kGrPixelConfigCnt];
- struct ReadPixelsSupportedFormat {
- GrGLenum fFormat;
- GrGLenum fType;
- GrGLenum fFboFormat;
-
- bool operator==(const ReadPixelsSupportedFormat& rhs) const {
- return fFormat == rhs.fFormat
- && fType == rhs.fType
- && fFboFormat == rhs.fFboFormat;
- }
- };
- mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCache;
-
typedef GrCaps INHERITED;
};
« no previous file with comments | « no previous file | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698