aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/src
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/src')
-rw-r--r--gpu/src/GrContext.cpp2
-rw-r--r--gpu/src/GrGpuGLFixed.cpp18
-rw-r--r--gpu/src/GrGpuGLShaders.cpp39
-rw-r--r--gpu/src/GrMatrix.cpp3
-rw-r--r--gpu/src/gr_unittests.cpp1
5 files changed, 32 insertions, 31 deletions
diff --git a/gpu/src/GrContext.cpp b/gpu/src/GrContext.cpp
index 84611878e3..2d93e4bbd6 100644
--- a/gpu/src/GrContext.cpp
+++ b/gpu/src/GrContext.cpp
@@ -925,7 +925,7 @@ void GrContext::drawRect(const GrPaint& paint,
GrVec strokeSize;;
if (width > 0) {
strokeSize.set(width, width);
- combinedMatrix.mapVec(&strokeSize);
+ combinedMatrix.mapVectors(&strokeSize, 1);
strokeSize.setAbs(strokeSize);
} else {
strokeSize.set(GR_Scalar1, GR_Scalar1);
diff --git a/gpu/src/GrGpuGLFixed.cpp b/gpu/src/GrGpuGLFixed.cpp
index dbfac436c8..e197a82533 100644
--- a/gpu/src/GrGpuGLFixed.cpp
+++ b/gpu/src/GrGpuGLFixed.cpp
@@ -32,17 +32,17 @@ struct GrGpuMatrix {
void set(const GrMatrix& m) {
Gr_bzero(fMat, sizeof(fMat));
- fMat[0] = GrScalarToFloat(m[GrMatrix::kScaleX]);
- fMat[4] = GrScalarToFloat(m[GrMatrix::kSkewX]);
- fMat[12] = GrScalarToFloat(m[GrMatrix::kTransX]);
+ fMat[0] = GrScalarToFloat(m[GrMatrix::kMScaleX]);
+ fMat[4] = GrScalarToFloat(m[GrMatrix::kMSkewX]);
+ fMat[12] = GrScalarToFloat(m[GrMatrix::kMTransX]);
- fMat[1] = GrScalarToFloat(m[GrMatrix::kSkewY]);
- fMat[5] = GrScalarToFloat(m[GrMatrix::kScaleY]);
- fMat[13] = GrScalarToFloat(m[GrMatrix::kTransY]);
+ fMat[1] = GrScalarToFloat(m[GrMatrix::kMSkewY]);
+ fMat[5] = GrScalarToFloat(m[GrMatrix::kMScaleY]);
+ fMat[13] = GrScalarToFloat(m[GrMatrix::kMTransY]);
- fMat[3] = GrScalarToFloat(m[GrMatrix::kPersp0]);
- fMat[7] = GrScalarToFloat(m[GrMatrix::kPersp1]);
- fMat[15] = GrScalarToFloat(m[GrMatrix::kPersp2]);
+ fMat[3] = GrScalarToFloat(m[GrMatrix::kMPersp0]);
+ fMat[7] = GrScalarToFloat(m[GrMatrix::kMPersp1]);
+ fMat[15] = GrScalarToFloat(m[GrMatrix::kMPersp2]);
fMat[10] = 1.f; // z-scale
}
diff --git a/gpu/src/GrGpuGLShaders.cpp b/gpu/src/GrGpuGLShaders.cpp
index c2b89716de..3ce6e55d69 100644
--- a/gpu/src/GrGpuGLShaders.cpp
+++ b/gpu/src/GrGpuGLShaders.cpp
@@ -273,7 +273,8 @@ void GrGpuGLShaders::resetContext() {
void GrGpuGLShaders::flushViewMatrix() {
GrAssert(NULL != fCurrDrawState.fRenderTarget);
- GrMatrix m (
+ GrMatrix m;
+ m.setAll(
GrIntToScalar(2) / fCurrDrawState.fRenderTarget->width(), 0, -GR_Scalar1,
0,-GrIntToScalar(2) / fCurrDrawState.fRenderTarget->height(), GR_Scalar1,
0, 0, GrMatrix::I()[8]);
@@ -282,15 +283,15 @@ void GrGpuGLShaders::flushViewMatrix() {
// ES doesn't allow you to pass true to the transpose param,
// so do our own transpose
GrScalar mt[] = {
- m[GrMatrix::kScaleX],
- m[GrMatrix::kSkewY],
- m[GrMatrix::kPersp0],
- m[GrMatrix::kSkewX],
- m[GrMatrix::kScaleY],
- m[GrMatrix::kPersp1],
- m[GrMatrix::kTransX],
- m[GrMatrix::kTransY],
- m[GrMatrix::kPersp2]
+ m[GrMatrix::kMScaleX],
+ m[GrMatrix::kMSkewY],
+ m[GrMatrix::kMPersp0],
+ m[GrMatrix::kMSkewX],
+ m[GrMatrix::kMScaleY],
+ m[GrMatrix::kMPersp1],
+ m[GrMatrix::kMTransX],
+ m[GrMatrix::kMTransY],
+ m[GrMatrix::kMPersp2]
};
if (GrGLProgram::kSetAsAttribute ==
@@ -327,15 +328,15 @@ void GrGpuGLShaders::flushTextureMatrix(int s) {
// ES doesn't allow you to pass true to the transpose param,
// so do our own transpose
GrScalar mt[] = {
- m[GrMatrix::kScaleX],
- m[GrMatrix::kSkewY],
- m[GrMatrix::kPersp0],
- m[GrMatrix::kSkewX],
- m[GrMatrix::kScaleY],
- m[GrMatrix::kPersp1],
- m[GrMatrix::kTransX],
- m[GrMatrix::kTransY],
- m[GrMatrix::kPersp2]
+ m[GrMatrix::kMScaleX],
+ m[GrMatrix::kMSkewY],
+ m[GrMatrix::kMPersp0],
+ m[GrMatrix::kMSkewX],
+ m[GrMatrix::kMScaleY],
+ m[GrMatrix::kMPersp1],
+ m[GrMatrix::kMTransX],
+ m[GrMatrix::kMTransY],
+ m[GrMatrix::kMPersp2]
};
if (GrGLProgram::kSetAsAttribute ==
fProgramData->fUniLocations.fStages[s].fTextureMatrixUni) {
diff --git a/gpu/src/GrMatrix.cpp b/gpu/src/GrMatrix.cpp
index c88c6e13f1..476d9a2293 100644
--- a/gpu/src/GrMatrix.cpp
+++ b/gpu/src/GrMatrix.cpp
@@ -19,6 +19,7 @@
#include "GrRect.h"
#include <stddef.h>
+#if 0
#if GR_SCALAR_IS_FLOAT
const GrScalar GrMatrix::gRESCALE(GR_Scalar1);
#else
@@ -688,6 +689,7 @@ void GrMatrix::UnitTest() {
}
///////////////////////////////////////////////////////////////////////////////
+#endif
int Gr_clz(uint32_t n) {
if (0 == n) {
@@ -716,4 +718,3 @@ int Gr_clz(uint32_t n) {
}
return count;
}
-
diff --git a/gpu/src/gr_unittests.cpp b/gpu/src/gr_unittests.cpp
index fd27f199a9..320dd15bd7 100644
--- a/gpu/src/gr_unittests.cpp
+++ b/gpu/src/gr_unittests.cpp
@@ -152,7 +152,6 @@ void gr_run_unittests() {
test_tdarray();
test_bsearch();
test_binHashKey();
- GrMatrix::UnitTest();
GrRedBlackTree<int>::UnitTest();
GrPath::ConvexUnitTest();
GrDrawTarget::VertexLayoutUnitTest();