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

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

Issue 1428543003: Create GLSL base class for ProgramDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add space Created 5 years, 1 month 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/GrGLGpuProgramCache.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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void invalidate() { 87 void invalidate() {
88 fViewMatrix = SkMatrix::InvalidMatrix(); 88 fViewMatrix = SkMatrix::InvalidMatrix();
89 fRenderTargetSize.fWidth = -1; 89 fRenderTargetSize.fWidth = -1;
90 fRenderTargetSize.fHeight = -1; 90 fRenderTargetSize.fHeight = -1;
91 fRenderTargetOrigin = (GrSurfaceOrigin) -1; 91 fRenderTargetOrigin = (GrSurfaceOrigin) -1;
92 } 92 }
93 93
94 /** 94 /**
95 * Gets a matrix that goes from local coordinates to GL normalized devic e coords. 95 * Gets a matrix that goes from local coordinates to GL normalized devic e coords.
96 */ 96 */
97 template<int Size> void getRTAdjustedGLMatrix(GrGLfloat* destMatrix) { 97 template<int Size> void getRTAdjustedGLMatrix(float* destMatrix) {
98 SkMatrix combined; 98 SkMatrix combined;
99 if (kBottomLeft_GrSurfaceOrigin == fRenderTargetOrigin) { 99 if (kBottomLeft_GrSurfaceOrigin == fRenderTargetOrigin) {
100 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0, -SK_Scalar1, 100 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0, -SK_Scalar1,
101 0, -SkIntToScalar(2) / fRenderTargetSize.fHeight , SK_Scalar1, 101 0, -SkIntToScalar(2) / fRenderTargetSize.fHeight , SK_Scalar1,
102 0, 0, 1); 102 0, 0, 1);
103 } else { 103 } else {
104 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0, -SK_Scalar1, 104 combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0, -SK_Scalar1,
105 0, SkIntToScalar(2) / fRenderTargetSize.fHeight, -SK_Scalar1, 105 0, SkIntToScalar(2) / fRenderTargetSize.fHeight, -SK_Scalar1,
106 0, 0, 1); 106 0, 0, 1);
107 } 107 }
108 combined.preConcat(fViewMatrix); 108 combined.preConcat(fViewMatrix);
109 GrGLGetMatrix<Size>(destMatrix, combined); 109 GrGLGetMatrix<Size>(destMatrix, combined);
110 } 110 }
111 }; 111 };
112 GrGLGpu* gpu(); 112 GrGLGpu* gpu();
113 113
114 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator; 114 SkAutoTDelete<GrGLNameAllocator> fPathNameAllocator;
115 MatrixState fHWProjectionMatrixState; 115 MatrixState fHWProjectionMatrixState;
116 GrStencilSettings fHWPathStencilSettings; 116 GrStencilSettings fHWPathStencilSettings;
117 Caps fCaps; 117 Caps fCaps;
118 }; 118 };
119 119
120 #endif 120 #endif
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLGpuProgramCache.cpp ('k') | src/gpu/gl/GrGLPathRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698