aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-10 17:30:58 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-10 17:30:58 +0000
commit59f46b81f8bdd1b524f5cc43bc27603f9604c71a (patch)
treec074f4d76c87c4ab67e32405327a0c10201ed7e8 /src/gpu
parent676e66096c60615bac52f365111596de5c4ca8a6 (diff)
Fixed Windows compiler complaints
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrDrawTarget.cpp2
-rw-r--r--src/gpu/GrPathUtils.cpp14
-rw-r--r--src/gpu/gl/GrGpuGL_program.cpp2
3 files changed, 11 insertions, 7 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index c2a308e803..60095abbe3 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -540,7 +540,7 @@ bool GrDrawTarget::reserveIndexSpace(int indexCount,
}
bool GrDrawTarget::StageUsesTexCoords(GrVertexLayout layout, int stage) {
- return layout & gStageTexCoordMasks[stage];
+ return SkToBool(layout & gStageTexCoordMasks[stage]);
}
bool GrDrawTarget::reserveVertexAndIndexSpace(GrVertexLayout vertexLayout,
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index aa18792574..4e487fd076 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -199,12 +199,16 @@ void GrPathUtils::QuadUVMatrix::set(const GrPoint qPts[3]) {
// [0 0 1]
// [1 1 1]
// We invert the control pt matrix and post concat to both sides to get M.
- UVpts.setAll(0, 0.5f, 1.f,
- 0, 0, 1.f,
- 1.f, 1.f, 1.f);
+ UVpts.setAll(0, GR_ScalarHalf, GR_Scalar1,
+ 0, 0, GR_Scalar1,
+ SkScalarToPersp(GR_Scalar1),
+ SkScalarToPersp(GR_Scalar1),
+ SkScalarToPersp(GR_Scalar1));
m.setAll(qPts[0].fX, qPts[1].fX, qPts[2].fX,
qPts[0].fY, qPts[1].fY, qPts[2].fY,
- 1.f, 1.f, 1.f);
+ SkScalarToPersp(GR_Scalar1),
+ SkScalarToPersp(GR_Scalar1),
+ SkScalarToPersp(GR_Scalar1));
if (!m.invert(&m)) {
// The quad is degenerate. Hopefully this is rare. Find the pts that are
// farthest apart to compute a line (unless it is really a pt).
@@ -247,7 +251,7 @@ void GrPathUtils::QuadUVMatrix::set(const GrPoint qPts[3]) {
m.postConcat(UVpts);
// The matrix should not have perspective.
- static const GrScalar gTOL = 1.f / 100.f;
+ static const GrScalar gTOL = GrFloatToScalar(1.f / 100.f);
GrAssert(GrScalarAbs(m.get(SkMatrix::kMPersp0)) < gTOL);
GrAssert(GrScalarAbs(m.get(SkMatrix::kMPersp1)) < gTOL);
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index d506c6c029..736be931d9 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -119,7 +119,7 @@ void GrGpuGL::flushViewMatrix(DrawType type) {
// and perform a y-flip.
GrMatrix m;
m.setScale(GrIntToScalar(2) / rt->width(), GrIntToScalar(-2) / rt->height());
- m.postTranslate(-1.f , 1.f);
+ m.postTranslate(-GR_Scalar1, GR_Scalar1);
m.preConcat(vm);
// GL wants a column-major 4x4.