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

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

Issue 304743004: Move ETC1 and LATC enums value to GrPixelConfig (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Only generate mipmaps for uncompressed textures. Created 6 years, 6 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 | « src/gpu/GrTexture.cpp ('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
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 /// maximum number of texture units accessible in the fragment shader. 199 /// maximum number of texture units accessible in the fragment shader.
200 int maxFragmentTextureUnits() const { return fMaxFragmentTextureUnits; } 200 int maxFragmentTextureUnits() const { return fMaxFragmentTextureUnits; }
201 201
202 /// maximum number of fixed-function texture coords, or zero if no fixed-fun ction. 202 /// maximum number of fixed-function texture coords, or zero if no fixed-fun ction.
203 int maxFixedFunctionTextureCoords() const { return fMaxFixedFunctionTextureC oords; } 203 int maxFixedFunctionTextureCoords() const { return fMaxFixedFunctionTextureC oords; }
204 204
205 /// ES requires an extension to support RGBA8 in RenderBufferStorage 205 /// ES requires an extension to support RGBA8 in RenderBufferStorage
206 bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; } 206 bool rgba8RenderbufferSupport() const { return fRGBA8RenderbufferSupport; }
207 207
208 /// Is GL_BGRA supported
209 bool bgraFormatSupport() const { return fBGRAFormatSupport; }
210
211 /** 208 /**
212 * Depending on the ES extensions present the BGRA external format may 209 * Depending on the ES extensions present the BGRA external format may
213 * correspond either a BGRA or RGBA internalFormat. On desktop GL it is 210 * correspond either a BGRA or RGBA internalFormat. On desktop GL it is
214 * RGBA. 211 * RGBA.
215 */ 212 */
216 bool bgraIsInternalFormat() const { return fBGRAIsInternalFormat; } 213 bool bgraIsInternalFormat() const { return fBGRAIsInternalFormat; }
217 214
218 /// GL_ARB_texture_swizzle support 215 /// GL_ARB_texture_swizzle support
219 bool textureSwizzleSupport() const { return fTextureSwizzleSupport; } 216 bool textureSwizzleSupport() const { return fTextureSwizzleSupport; }
220 217
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 260
264 bool fullClearIsFree() const { return fFullClearIsFree; } 261 bool fullClearIsFree() const { return fFullClearIsFree; }
265 262
266 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; } 263 bool dropsTileOnZeroDivide() const { return fDropsTileOnZeroDivide; }
267 264
268 /** 265 /**
269 * Returns a string containing the caps info. 266 * Returns a string containing the caps info.
270 */ 267 */
271 virtual SkString dump() const SK_OVERRIDE; 268 virtual SkString dump() const SK_OVERRIDE;
272 269
270 /**
271 * LATC can appear under one of three possible names. In order to know
272 * which GL internal format to use, we need to keep track of which name
273 * we found LATC under. The default is LATC.
274 */
275 enum LATCAlias {
276 kLATC_LATCAlias,
277 kRGTC_LATCAlias,
278 k3DC_LATCAlias
279 };
280
281 LATCAlias latcAlias() const { return fLATCAlias; }
282
273 private: 283 private:
274 /** 284 /**
275 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly 285 * Maintains a bit per GrPixelConfig. It is used to avoid redundantly
276 * performing glCheckFrameBufferStatus for the same config. 286 * performing glCheckFrameBufferStatus for the same config.
277 */ 287 */
278 struct VerifiedColorConfigs { 288 struct VerifiedColorConfigs {
279 VerifiedColorConfigs() { 289 VerifiedColorConfigs() {
280 this->reset(); 290 this->reset();
281 } 291 }
282 292
(...skipping 22 matching lines...) Expand all
305 int u32Idx = config / 32; 315 int u32Idx = config / 32;
306 int bitIdx = config % 32; 316 int bitIdx = config % 32;
307 return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx)); 317 return SkToBool(fVerifiedColorConfigs[u32Idx] & (1 << bitIdx));
308 } 318 }
309 }; 319 };
310 320
311 void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*); 321 void initFSAASupport(const GrGLContextInfo&, const GrGLInterface*);
312 void initStencilFormats(const GrGLContextInfo&); 322 void initStencilFormats(const GrGLContextInfo&);
313 // This must be called after initFSAASupport(). 323 // This must be called after initFSAASupport().
314 void initConfigRenderableTable(const GrGLContextInfo&); 324 void initConfigRenderableTable(const GrGLContextInfo&);
315 325 void initConfigTexturableTable(const GrGLContextInfo&, const GrGLInterface*) ;
316 void initCompressedTextureSupport(const GrGLContextInfo &);
317 326
318 // tracks configs that have been verified to pass the FBO completeness when 327 // tracks configs that have been verified to pass the FBO completeness when
319 // used as a color attachment 328 // used as a color attachment
320 VerifiedColorConfigs fVerifiedColorConfigs; 329 VerifiedColorConfigs fVerifiedColorConfigs;
321 330
322 SkTArray<StencilFormat, true> fStencilFormats; 331 SkTArray<StencilFormat, true> fStencilFormats;
323 // tracks configs that have been verified to pass the FBO completeness when 332 // tracks configs that have been verified to pass the FBO completeness when
324 // used as a color attachment when a particular stencil format is used 333 // used as a color attachment when a particular stencil format is used
325 // as a stencil attachment. 334 // as a stencil attachment.
326 SkTArray<VerifiedColorConfigs, true> fStencilVerifiedColorConfigs; 335 SkTArray<VerifiedColorConfigs, true> fStencilVerifiedColorConfigs;
327 336
328 int fMaxFragmentUniformVectors; 337 int fMaxFragmentUniformVectors;
329 int fMaxVertexAttributes; 338 int fMaxVertexAttributes;
330 int fMaxFragmentTextureUnits; 339 int fMaxFragmentTextureUnits;
331 int fMaxFixedFunctionTextureCoords; 340 int fMaxFixedFunctionTextureCoords;
332 341
333 MSFBOType fMSFBOType; 342 MSFBOType fMSFBOType;
334 FBFetchType fFBFetchType; 343 FBFetchType fFBFetchType;
335 InvalidateFBType fInvalidateFBType; 344 InvalidateFBType fInvalidateFBType;
336 MapBufferType fMapBufferType; 345 MapBufferType fMapBufferType;
346 LATCAlias fLATCAlias;
337 347
338 bool fRGBA8RenderbufferSupport : 1; 348 bool fRGBA8RenderbufferSupport : 1;
339 bool fBGRAFormatSupport : 1;
340 bool fBGRAIsInternalFormat : 1; 349 bool fBGRAIsInternalFormat : 1;
341 bool fTextureSwizzleSupport : 1; 350 bool fTextureSwizzleSupport : 1;
342 bool fUnpackRowLengthSupport : 1; 351 bool fUnpackRowLengthSupport : 1;
343 bool fUnpackFlipYSupport : 1; 352 bool fUnpackFlipYSupport : 1;
344 bool fPackRowLengthSupport : 1; 353 bool fPackRowLengthSupport : 1;
345 bool fPackFlipYSupport : 1; 354 bool fPackFlipYSupport : 1;
346 bool fTextureUsageSupport : 1; 355 bool fTextureUsageSupport : 1;
347 bool fTexStorageSupport : 1; 356 bool fTexStorageSupport : 1;
348 bool fTextureRedSupport : 1; 357 bool fTextureRedSupport : 1;
349 bool fImagingSupport : 1; 358 bool fImagingSupport : 1;
350 bool fTwoFormatLimit : 1; 359 bool fTwoFormatLimit : 1;
351 bool fFragCoordsConventionSupport : 1; 360 bool fFragCoordsConventionSupport : 1;
352 bool fVertexArrayObjectSupport : 1; 361 bool fVertexArrayObjectSupport : 1;
353 bool fUseNonVBOVertexAndIndexDynamicData : 1; 362 bool fUseNonVBOVertexAndIndexDynamicData : 1;
354 bool fIsCoreProfile : 1; 363 bool fIsCoreProfile : 1;
355 bool fFullClearIsFree : 1; 364 bool fFullClearIsFree : 1;
356 bool fDropsTileOnZeroDivide : 1; 365 bool fDropsTileOnZeroDivide : 1;
357 366
358 typedef GrDrawTargetCaps INHERITED; 367 typedef GrDrawTargetCaps INHERITED;
359 }; 368 };
360 369
361 #endif 370 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTexture.cpp ('k') | src/gpu/gl/GrGLCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698