diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-10 17:30:58 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-10 17:30:58 +0000 |
commit | 59f46b81f8bdd1b524f5cc43bc27603f9604c71a (patch) | |
tree | c074f4d76c87c4ab67e32405327a0c10201ed7e8 /src | |
parent | 676e66096c60615bac52f365111596de5c4ca8a6 (diff) |
Fixed Windows compiler complaints
http://codereview.appspot.com/6392044
git-svn-id: http://skia.googlecode.com/svn/trunk@4511 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/animator/SkScriptTokenizer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/GrDrawTarget.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrPathUtils.cpp | 14 | ||||
-rw-r--r-- | src/gpu/gl/GrGpuGL_program.cpp | 2 | ||||
-rw-r--r-- | src/pdf/SkPDFDevice.cpp | 2 | ||||
-rw-r--r-- | src/pdf/SkPDFImage.cpp | 4 | ||||
-rw-r--r-- | src/pipe/SkGPipeWrite.cpp | 2 | ||||
-rw-r--r-- | src/views/SkTouchGesture.cpp | 14 |
8 files changed, 24 insertions, 20 deletions
diff --git a/src/animator/SkScriptTokenizer.cpp b/src/animator/SkScriptTokenizer.cpp index 54aa2bff8b..1be7427275 100644 --- a/src/animator/SkScriptTokenizer.cpp +++ b/src/animator/SkScriptTokenizer.cpp @@ -750,7 +750,7 @@ scalarCommon: decompile(data.bytes(), data.size()); #endif SkScriptRuntime runtime(fCallBackArray); - runtime.executeTokens((unsigned char*) data.bytes()); + runtime.executeTokens((unsigned char*) data->bytes()); SkScriptValue2 value1; runtime.getResult(&value1.fOperand); value1.fType = fReturnType; @@ -1158,7 +1158,7 @@ bool SkScriptEngine2::processOp() { decompile(data.bytes(), data.size()); #endif SkScriptRuntime runtime(fCallBackArray); - runtime.executeTokens((unsigned char*)data.bytes()); + runtime.executeTokens((unsigned char*)data->bytes()); runtime.getResult(&value1.fOperand); if (attributes->fResultIsBoolean == kResultIsBoolean) value1.fType = SkOperand2::kS32; 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. diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp index 68c210d2bc..d05b640682 100644 --- a/src/pdf/SkPDFDevice.cpp +++ b/src/pdf/SkPDFDevice.cpp @@ -1119,7 +1119,7 @@ void SkPDFDevice::copyContentEntriesToData(ContentEntry* entry, gsState.updateDrawingState(entry->fState); SkAutoDataUnref copy(entry->fContent.copyToData()); - data->write(copy.data(), copy.size()); + data->write(copy->data(), copy->size()); entry = entry->fNext.get(); } gsState.drainStack(); diff --git a/src/pdf/SkPDFImage.cpp b/src/pdf/SkPDFImage.cpp index 72379b1e36..429667a5e2 100644 --- a/src/pdf/SkPDFImage.cpp +++ b/src/pdf/SkPDFImage.cpp @@ -338,10 +338,10 @@ SkPDFImage::SkPDFImage(SkStream* imageData, const SkBitmap& bitmap, SkRefPtr<SkPDFInt> zeroVal = new SkPDFInt(0); zeroVal->unref(); // SkRefPtr and new both took a reference. SkRefPtr<SkPDFScalar> scale5Val = - new SkPDFScalar(8.2258f); // 255/2^5-1 + new SkPDFScalar(SkFloatToScalar(8.2258f)); // 255/2^5-1 scale5Val->unref(); // SkRefPtr and new both took a reference. SkRefPtr<SkPDFScalar> scale6Val = - new SkPDFScalar(4.0476f); // 255/2^6-1 + new SkPDFScalar(SkFloatToScalar(4.0476f)); // 255/2^6-1 scale6Val->unref(); // SkRefPtr and new both took a reference. SkRefPtr<SkPDFArray> decodeValue = new SkPDFArray(); decodeValue->unref(); // SkRefPtr and new both took a reference. diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp index e257144b4a..e546b5c592 100644 --- a/src/pipe/SkGPipeWrite.cpp +++ b/src/pipe/SkGPipeWrite.cpp @@ -51,7 +51,7 @@ static size_t writeTypeface(SkWriter32* writer, SkTypeface* typeface) { if (writer) { writer->write32(size); SkAutoDataUnref data(stream.copyToData()); - writer->writePad(data.data(), size); + writer->writePad(data->data(), size); } return 4 + SkAlign4(size); } diff --git a/src/views/SkTouchGesture.cpp b/src/views/SkTouchGesture.cpp index 31adc74b38..1828f0390b 100644 --- a/src/views/SkTouchGesture.cpp +++ b/src/views/SkTouchGesture.cpp @@ -14,9 +14,9 @@ #define DISCRETIZE_TRANSLATE_TO_AVOID_FLICKER true -static const float MAX_FLING_SPEED = 1500; +static const SkScalar MAX_FLING_SPEED = SkIntToScalar(1500); -static float pin_max_fling(float speed) { +static SkScalar pin_max_fling(SkScalar speed) { if (speed > MAX_FLING_SPEED) { speed = MAX_FLING_SPEED; } @@ -50,7 +50,7 @@ static void unit_axis_align(SkVector* unit) { void SkFlingState::reset(float sx, float sy) { fActive = true; - fDirection.set(sx, sy); + fDirection.set(SkFloatToScalar(sx), SkFloatToScalar(sy)); fSpeed0 = SkPoint::Normalize(&fDirection); fSpeed0 = pin_max_fling(fSpeed0); fTime0 = getseconds(); @@ -82,7 +82,7 @@ bool SkFlingState::evaluateMatrix(SkMatrix* matrix) { tx = (float)sk_float_round2int(tx); ty = (float)sk_float_round2int(ty); } - matrix->setTranslate(tx, ty); + matrix->setTranslate(SkFloatToScalar(tx), SkFloatToScalar(ty)); // printf("---- evaluate (%g %g)\n", tx, ty); return true; @@ -181,8 +181,8 @@ int SkTouchGesture::findRec(void* owner) const { return -1; } -static float center(float pos0, float pos1) { - return (pos0 + pos1) * 0.5f; +static SkScalar center(float pos0, float pos1) { + return SkFloatToScalar((pos0 + pos1) * 0.5f); } static const float MAX_ZOOM_SCALE = 4; @@ -190,7 +190,7 @@ static const float MIN_ZOOM_SCALE = 0.25f; float SkTouchGesture::limitTotalZoom(float scale) const { // this query works 'cause we know that we're square-scale w/ no skew/rotation - const float curr = fGlobalM[0]; + const float curr = SkScalarToFloat(fGlobalM[0]); if (scale > 1 && curr * scale > MAX_ZOOM_SCALE) { scale = MAX_ZOOM_SCALE / curr; |