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

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

Issue 212753002: Use fixed function pipeline only when drawing paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 8 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/gl/GrGLShaderBuilder.cpp ('k') | src/gpu/gl/GrGpuGL.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 2011 Google Inc. 2 * Copyright 2011 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 #ifndef GrGpuGL_DEFINED 8 #ifndef GrGpuGL_DEFINED
9 #define GrGpuGL_DEFINED 9 #define GrGpuGL_DEFINED
10 10
(...skipping 24 matching lines...) Expand all
35 35
36 const GrGLInterface* glInterface() const { return fGLContext.interface(); } 36 const GrGLInterface* glInterface() const { return fGLContext.interface(); }
37 const GrGLContextInfo& ctxInfo() const { return fGLContext; } 37 const GrGLContextInfo& ctxInfo() const { return fGLContext; }
38 GrGLStandard glStandard() const { return fGLContext.standard(); } 38 GrGLStandard glStandard() const { return fGLContext.standard(); }
39 GrGLVersion glVersion() const { return fGLContext.version(); } 39 GrGLVersion glVersion() const { return fGLContext.version(); }
40 GrGLSLGeneration glslGeneration() const { return fGLContext.glslGeneration() ; } 40 GrGLSLGeneration glslGeneration() const { return fGLContext.glslGeneration() ; }
41 const GrGLCaps& glCaps() const { return *fGLContext.caps(); } 41 const GrGLCaps& glCaps() const { return *fGLContext.caps(); }
42 42
43 virtual void discard(GrRenderTarget*) SK_OVERRIDE; 43 virtual void discard(GrRenderTarget*) SK_OVERRIDE;
44 44
45 // Used by GrGLProgram and GrGLTexGenProgramEffects to configure OpenGL stat e. 45 // Used by GrGLProgram and GrGLPathTexGenProgramEffects to configure OpenGL
46 // state.
46 void bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* te xture); 47 void bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* te xture);
47 void setProjectionMatrix(const SkMatrix& matrix, 48 void setProjectionMatrix(const SkMatrix& matrix,
48 const SkISize& renderTargetSize, 49 const SkISize& renderTargetSize,
49 GrSurfaceOrigin renderTargetOrigin); 50 GrSurfaceOrigin renderTargetOrigin);
50 enum TexGenComponents { 51 enum PathTexGenComponents {
51 kS_TexGenComponents = 1, 52 kS_PathTexGenComponents = 1,
52 kST_TexGenComponents = 2, 53 kST_PathTexGenComponents = 2,
53 kSTR_TexGenComponents = 3 54 kSTR_PathTexGenComponents = 3
54 }; 55 };
55 void enableTexGen(int unitIdx, TexGenComponents, const GrGLfloat* coefficien ts); 56 void enablePathTexGen(int unitIdx, PathTexGenComponents, const GrGLfloat* co efficients);
56 void enableTexGen(int unitIdx, TexGenComponents, const SkMatrix& matrix); 57 void enablePathTexGen(int unitIdx, PathTexGenComponents, const SkMatrix& mat rix);
57 void flushTexGenSettings(int numUsedTexCoordSets); 58 void flushPathTexGenSettings(int numUsedTexCoordSets);
58 bool shouldUseFixedFunctionTexturing() const { 59 bool shouldUseFixedFunctionTexturing() const {
59 return this->glCaps().fixedFunctionSupport() && 60 return this->glCaps().pathRenderingSupport();
60 this->glCaps().pathRenderingSupport();
61 } 61 }
62 62
63 bool programUnitTest(int maxStages); 63 bool programUnitTest(int maxStages);
64 64
65 // GrGpu overrides 65 // GrGpu overrides
66 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig readConfig, 66 virtual GrPixelConfig preferredReadPixelsConfig(GrPixelConfig readConfig,
67 GrPixelConfig surfaceConfig) const SK_OVERRIDE; 67 GrPixelConfig surfaceConfig) const SK_OVERRIDE;
68 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig writeConfig, 68 virtual GrPixelConfig preferredWritePixelsConfig(GrPixelConfig writeConfig,
69 GrPixelConfig surfaceConfig ) const SK_OVERRIDE; 69 GrPixelConfig surfaceConfig ) const SK_OVERRIDE;
70 virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig ) const SK_OVERRIDE; 70 virtual bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig ) const SK_OVERRIDE;
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 GrStencilSettings fHWStencilSettings; 439 GrStencilSettings fHWStencilSettings;
440 TriState fHWStencilTestEnabled; 440 TriState fHWStencilTestEnabled;
441 GrStencilSettings fHWPathStencilSettings; 441 GrStencilSettings fHWPathStencilSettings;
442 442
443 GrDrawState::DrawFace fHWDrawFace; 443 GrDrawState::DrawFace fHWDrawFace;
444 TriState fHWWriteToColor; 444 TriState fHWWriteToColor;
445 TriState fHWDitherEnabled; 445 TriState fHWDitherEnabled;
446 GrRenderTarget* fHWBoundRenderTarget; 446 GrRenderTarget* fHWBoundRenderTarget;
447 SkTArray<GrTexture*, true> fHWBoundTextures; 447 SkTArray<GrTexture*, true> fHWBoundTextures;
448 448
449 struct TexGenData { 449 struct PathTexGenData {
450 GrGLenum fMode; 450 GrGLenum fMode;
451 GrGLint fNumComponents; 451 GrGLint fNumComponents;
452 GrGLfloat fCoefficients[3 * 3]; 452 GrGLfloat fCoefficients[3 * 3];
453 }; 453 };
454 int fHWActiveTexGenSets; 454 int fHWActivePathTexGenSets;
455 SkTArray<TexGenData, true> fHWTexGenSettings; 455 SkTArray<PathTexGenData, true> fHWPathTexGenSettings;
456 ///@} 456 ///@}
457 457
458 // we record what stencil format worked last time to hopefully exit early 458 // we record what stencil format worked last time to hopefully exit early
459 // from our loop that tries stencil formats and calls check fb status. 459 // from our loop that tries stencil formats and calls check fb status.
460 int fLastSuccessfulStencilFmtIdx; 460 int fLastSuccessfulStencilFmtIdx;
461 461
462 typedef GrGpu INHERITED; 462 typedef GrGpu INHERITED;
463 }; 463 };
464 464
465 #endif 465 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLShaderBuilder.cpp ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698