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

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

Issue 1157683006: Refactor GrGpu path rendering functions to GrPathRendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase, remove include ordering Created 5 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/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLPathRendering.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 2014 Google Inc. 2 * Copyright 2014 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 GrGLPathRendering_DEFINED 8 #ifndef GrGLPathRendering_DEFINED
9 #define GrGLPathRendering_DEFINED 9 #define GrGLPathRendering_DEFINED
10 10
(...skipping 21 matching lines...) Expand all
32 GrGLPathRendering(GrGLGpu* gpu); 32 GrGLPathRendering(GrGLGpu* gpu);
33 virtual ~GrGLPathRendering(); 33 virtual ~GrGLPathRendering();
34 34
35 // GrPathRendering implementations. 35 // GrPathRendering implementations.
36 GrPath* createPath(const SkPath&, const GrStrokeInfo&) override; 36 GrPath* createPath(const SkPath&, const GrStrokeInfo&) override;
37 virtual GrPathRange* createPathRange(GrPathRange::PathGenerator*, 37 virtual GrPathRange* createPathRange(GrPathRange::PathGenerator*,
38 const GrStrokeInfo&) override; 38 const GrStrokeInfo&) override;
39 virtual GrPathRange* createGlyphs(const SkTypeface*, 39 virtual GrPathRange* createGlyphs(const SkTypeface*,
40 const SkDescriptor*, 40 const SkDescriptor*,
41 const GrStrokeInfo&) override; 41 const GrStrokeInfo&) override;
42 void stencilPath(const GrPath*, const GrStencilSettings&) override;
43 void drawPath(const GrPath*, const GrStencilSettings&) override;
44 virtual void drawPaths(const GrPathRange*, const void* indices, PathIndexTyp e,
45 const float transformValues[], PathTransformType, int count,
46 const GrStencilSettings&) override;
47 42
48 /* Called when the 3D context state is unknown. */ 43 /* Called when the 3D context state is unknown. */
49 void resetContext(); 44 void resetContext();
50 45
51 /** 46 /**
52 * Called when the GPU resources have been lost and need to be abandoned 47 * Called when the GPU resources have been lost and need to be abandoned
53 * (for example after a context loss). 48 * (for example after a context loss).
54 */ 49 */
55 void abandonGpuResources(); 50 void abandonGpuResources();
56 51
57 // Functions for "separable shader" texturing support. 52 // Functions for "separable shader" texturing support.
58 void setProgramPathFragmentInputTransform(GrGLuint program, GrGLint location , 53 void setProgramPathFragmentInputTransform(GrGLuint program, GrGLint location ,
59 GrGLenum genMode, GrGLint componen ts, 54 GrGLenum genMode, GrGLint componen ts,
60 const SkMatrix&); 55 const SkMatrix&);
61 56
62 /* Sets the projection matrix for path rendering */ 57 /* Sets the projection matrix for path rendering */
63 void setProjectionMatrix(const SkMatrix& matrix, 58 void setProjectionMatrix(const SkMatrix& matrix,
64 const SkISize& renderTargetSize, 59 const SkISize& renderTargetSize,
65 GrSurfaceOrigin renderTargetOrigin); 60 GrSurfaceOrigin renderTargetOrigin);
66 61
67 GrGLuint genPaths(GrGLsizei range); 62 GrGLuint genPaths(GrGLsizei range);
68 GrGLvoid deletePaths(GrGLuint path, GrGLsizei range); 63 GrGLvoid deletePaths(GrGLuint path, GrGLsizei range);
69 64
65 protected:
66 void onStencilPath(const StencilPathArgs&, const GrPath*) override;
67 void onDrawPath(const DrawPathArgs&, const GrPath*) override;
68 void onDrawPaths(const DrawPathArgs&, const GrPathRange*, const void* indice s, PathIndexType,
69 const float transformValues[], PathTransformType, int count ) override;
70 private: 70 private:
71 /** 71 /**
72 * Mark certain functionality as not supported if the driver version is too 72 * Mark certain functionality as not supported if the driver version is too
73 * old and a backup implementation is not practical. 73 * old and a backup implementation is not practical.
74 */ 74 */
75 struct Caps { 75 struct Caps {
76 bool stencilThenCoverSupport : 1; 76 bool stencilThenCoverSupport : 1;
77 bool fragmentInputGenSupport : 1; 77 bool fragmentInputGenSupport : 1;
78 bool glyphLoadingSupport : 1; 78 bool glyphLoadingSupport : 1;
79 }; 79 };
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 0, 0, 1); 122 0, 0, 1);
123 } else { 123 } else {
124 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0, -SK_Scalar1, 124 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0, -SK_Scalar1,
125 0, SkIntToScalar(2) / fRenderTargetSize.fHeight, -SK_Scalar1, 125 0, SkIntToScalar(2) / fRenderTargetSize.fHeight, -SK_Scalar1,
126 0, 0, 1); 126 0, 0, 1);
127 } 127 }
128 combined.preConcat(fViewMatrix); 128 combined.preConcat(fViewMatrix);
129 GrGLGetMatrix<Size>(destMatrix, combined); 129 GrGLGetMatrix<Size>(destMatrix, combined);
130 } 130 }
131 }; 131 };
132 GrGLGpu* gpu();
132 133
133 GrGLGpu* fGpu;
134 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator; 134 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator;
135 Caps fCaps; 135 Caps fCaps;
136 MatrixState fHWProjectionMatrixState; 136 MatrixState fHWProjectionMatrixState;
137 GrStencilSettings fHWPathStencilSettings; 137 GrStencilSettings fHWPathStencilSettings;
138 struct PathTexGenData { 138 struct PathTexGenData {
139 GrGLenum fMode; 139 GrGLenum fMode;
140 GrGLint fNumComponents; 140 GrGLint fNumComponents;
141 GrGLfloat fCoefficients[3 * 3]; 141 GrGLfloat fCoefficients[3 * 3];
142 }; 142 };
143 }; 143 };
144 144
145 #endif 145 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | src/gpu/gl/GrGLPathRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698