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

Side by Side Diff: src/gpu/gl/GrGLCaps.h

Issue 1264003002: SRGB read and write pixels working and unit test (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 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 unified diff | Download patch
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef GrGLCaps_DEFINED 9 #ifndef GrGLCaps_DEFINED
10 #define GrGLCaps_DEFINED 10 #define GrGLCaps_DEFINED
11 11
12 #include "GrCaps.h" 12 #include "GrCaps.h"
13 #include "glsl/GrGLSL.h" 13 #include "glsl/GrGLSL.h"
14 #include "GrGLStencilAttachment.h" 14 #include "GrGLStencilAttachment.h"
15 #include "SkChecksum.h" 15 #include "SkChecksum.h"
16 #include "SkTHash.h" 16 #include "SkTHash.h"
17 #include "SkTArray.h" 17 #include "SkTArray.h"
18 18
19 class GrGLContextInfo; 19 class GrGLContextInfo;
20 class GrGLSLCaps; 20 class GrGLSLCaps;
21 21
22 /** 22 /**
23 * Stores some capabilities of a GL context. Most are determined by the GL 23 * Stores some capabilities of a GL context. Most are determined by the GL
24 * version and the extensions string. It also tracks formats that have passed 24 * version and the extensions string. It also tracks formats that have passed
25 * the FBO completeness test. 25 * the FBO completeness test.
26 */ 26 */
27 class GrGLCaps : public GrCaps { 27 class GrGLCaps : public GrCaps {
28 public: 28 public:
29
30
31 typedef GrGLStencilAttachment::Format StencilFormat; 29 typedef GrGLStencilAttachment::Format StencilFormat;
32 30
33 /** 31 /**
34 * The type of MSAA for FBOs supported. Different extensions have different 32 * The type of MSAA for FBOs supported. Different extensions have different
35 * semantics of how / when a resolve is performed. 33 * semantics of how / when a resolve is performed.
36 */ 34 */
37 enum MSFBOType { 35 enum MSFBOType {
38 /** 36 /**
39 * no support for MSAA FBOs 37 * no support for MSAA FBOs
40 */ 38 */
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 245 }
248 246
249 /// Does ReadPixels support the provided format/type combo? 247 /// Does ReadPixels support the provided format/type combo?
250 bool readPixelsSupported(const GrGLInterface* intf, 248 bool readPixelsSupported(const GrGLInterface* intf,
251 GrGLenum format, 249 GrGLenum format,
252 GrGLenum type, 250 GrGLenum type,
253 GrGLenum currFboFormat) const; 251 GrGLenum currFboFormat) const;
254 252
255 bool isCoreProfile() const { return fIsCoreProfile; } 253 bool isCoreProfile() const { return fIsCoreProfile; }
256 254
257
258 bool fullClearIsFree() const { return fFullClearIsFree; } 255 bool fullClearIsFree() const { return fFullClearIsFree; }
259 256
260 bool bindFragDataLocationSupport() const { return fBindFragDataLocationSuppo rt; } 257 bool bindFragDataLocationSupport() const { return fBindFragDataLocationSuppo rt; }
261 258
262 /** 259 /**
260 * Is there support for enabling/disabling sRGB writes for sRGB-capable colo r attachments?
261 * If false this does not mean sRGB is not supported but rather that if it i s supported
262 * it cannot be turned off for configs that support it.
263 */
264 bool srgbWriteControl() const { return fSRGBWriteControl; }
265
266 /**
263 * Returns a string containing the caps info. 267 * Returns a string containing the caps info.
264 */ 268 */
265 SkString dump() const override; 269 SkString dump() const override;
266 270
267 /** 271 /**
268 * LATC can appear under one of three possible names. In order to know 272 * LATC can appear under one of three possible names. In order to know
269 * which GL internal format to use, we need to keep track of which name 273 * which GL internal format to use, we need to keep track of which name
270 * we found LATC under. The default is LATC. 274 * we found LATC under. The default is LATC.
271 */ 275 */
272 enum LATCAlias { 276 enum LATCAlias {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 int u32Idx = config / 32; 321 int u32Idx = config / 32;
318 int bitIdx = config % 32; 322 int bitIdx = config % 32;
319 return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx)); 323 return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx));
320 } 324 }
321 }; 325 };
322 326
323 void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*); 327 void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*);
324 void initBlendEqationSupport(const GrGLContextInfo&); 328 void initBlendEqationSupport(const GrGLContextInfo&);
325 void initStencilFormats(const GrGLContextInfo&); 329 void initStencilFormats(const GrGLContextInfo&);
326 // This must be called after initFSAASupport(). 330 // This must be called after initFSAASupport().
327 void initConfigRenderableTable(const GrGLContextInfo&); 331 void initConfigRenderableTable(const GrGLContextInfo&, bool srgbSupport);
328 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*) ; 332 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*, bool srgbSupport);
329 333
330 bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLe num type) const; 334 bool doReadPixelsSupported(const GrGLInterface* intf, GrGLenum format, GrGLe num type) const;
331 335
332 void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo, 336 void initShaderPrecisionTable(const GrGLContextInfo& ctxInfo,
333 const GrGLInterface* intf, 337 const GrGLInterface* intf,
334 GrGLSLCaps* glslCaps); 338 GrGLSLCaps* glslCaps);
335 339
336 // tracks configs that have been verified to pass the FBO completeness when 340 // tracks configs that have been verified to pass the FBO completeness when
337 // used as a color attachment 341 // used as a color attachment
338 VerifiedColorConfigs fVerifiedColorConfigs; 342 VerifiedColorConfigs fVerifiedColorConfigs;
(...skipping 29 matching lines...) Expand all
368 bool fVertexArrayObjectSupport : 1; 372 bool fVertexArrayObjectSupport : 1;
369 bool fInstancedDrawingSupport : 1; 373 bool fInstancedDrawingSupport : 1;
370 bool fDirectStateAccessSupport : 1; 374 bool fDirectStateAccessSupport : 1;
371 bool fDebugSupport : 1; 375 bool fDebugSupport : 1;
372 bool fES2CompatibilitySupport : 1; 376 bool fES2CompatibilitySupport : 1;
373 bool fMultisampleDisableSupport : 1; 377 bool fMultisampleDisableSupport : 1;
374 bool fUseNonVBOVertexAndIndexDynamicData : 1; 378 bool fUseNonVBOVertexAndIndexDynamicData : 1;
375 bool fIsCoreProfile : 1; 379 bool fIsCoreProfile : 1;
376 bool fFullClearIsFree : 1; 380 bool fFullClearIsFree : 1;
377 bool fBindFragDataLocationSupport : 1; 381 bool fBindFragDataLocationSupport : 1;
382 bool fSRGBWriteControl : 1;
378 383
379 struct ReadPixelsSupportedFormat { 384 struct ReadPixelsSupportedFormat {
380 GrGLenum fFormat; 385 GrGLenum fFormat;
381 GrGLenum fType; 386 GrGLenum fType;
382 GrGLenum fFboFormat; 387 GrGLenum fFboFormat;
383 388
384 bool operator==(const ReadPixelsSupportedFormat& rhs) const { 389 bool operator==(const ReadPixelsSupportedFormat& rhs) const {
385 return fFormat == rhs.fFormat 390 return fFormat == rhs.fFormat
386 && fType == rhs.fType 391 && fType == rhs.fType
387 && fFboFormat == rhs.fFboFormat; 392 && fFboFormat == rhs.fFboFormat;
388 } 393 }
389 }; 394 };
390 mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCach e; 395 mutable SkTHashMap<ReadPixelsSupportedFormat, bool> fReadPixelsSupportedCach e;
391 396
392 typedef GrCaps INHERITED; 397 typedef GrCaps INHERITED;
393 }; 398 };
394 399
395 #endif 400 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrTypes.h ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698