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

Unified Diff: src/gpu/gl/GrGLProgram.h

Issue 827973002: ViewMatrix uniform upload moved to GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@vm-on-gp
Patch Set: more cleanup Created 6 years 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 side-by-side diff with in-line comments
Download patch
Index: src/gpu/gl/GrGLProgram.h
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 3ee71b85b1383e96afed343fa383c6d013d4bdea..578aed1aa765cb40bbba57649bfff0e8961739d0 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -66,44 +66,17 @@ public:
* target may require us to perform a mirror-flip.
*/
struct MatrixState {
bsalomon 2014/12/30 13:19:39 Change to RenderTargetState? Also, the above comme
- SkMatrix fViewMatrix;
SkISize fRenderTargetSize;
GrSurfaceOrigin fRenderTargetOrigin;
MatrixState() { this->invalidate(); }
void invalidate() {
- fViewMatrix = SkMatrix::InvalidMatrix();
fRenderTargetSize.fWidth = -1;
fRenderTargetSize.fHeight = -1;
fRenderTargetOrigin = (GrSurfaceOrigin) -1;
}
/**
- * Gets a matrix that goes from local coords to Skia's device coordinates.
- */
- template<int Size> void getGLMatrix(GrGLfloat* destMatrix) {
- GrGLGetMatrix<Size>(destMatrix, fViewMatrix);
- }
-
- /**
- * Gets a matrix that goes from local coordinates to GL normalized device coords.
- */
- template<int Size> void getRTAdjustedGLMatrix(GrGLfloat* destMatrix) {
- SkMatrix combined;
- if (kBottomLeft_GrSurfaceOrigin == fRenderTargetOrigin) {
- combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0, -SK_Scalar1,
- 0, -SkIntToScalar(2) / fRenderTargetSize.fHeight, SK_Scalar1,
- 0, 0, 1);
- } else {
- combined.setAll(SkIntToScalar(2) / fRenderTargetSize.fWidth, 0, -SK_Scalar1,
- 0, SkIntToScalar(2) / fRenderTargetSize.fHeight, -SK_Scalar1,
- 0, 0, 1);
- }
- combined.preConcat(fViewMatrix);
- GrGLGetMatrix<Size>(destMatrix, combined);
- }
-
- /**
* Gets a vec4 that adjusts the position from Skia device coords to GL's normalized device
* coords. Assuming the transformed position, pos, is a homogeneous vec3, the vec, v, is
* applied as such:

Powered by Google App Engine
This is Rietveld 408576698