From 7064e9a3fc2fe54856d66ede84eddee2cace01b9 Mon Sep 17 00:00:00 2001 From: "skia.committer@gmail.com" Date: Wed, 26 Sep 2012 02:01:18 +0000 Subject: [PATCH] Sanitizing source files in Skia_Periodic_House_Keeping git-svn-id: http://skia.googlecode.com/svn/trunk@5678 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SampleBitmapRect.cpp | 14 +++++++------- src/core/SkCanvas.cpp | 6 +++--- src/core/SkDevice.cpp | 14 +++++++------- src/gpu/SkGpuDevice.cpp | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp index 18208fb..3f895fc 100644 --- a/samplecode/SampleBitmapRect.cpp +++ b/samplecode/SampleBitmapRect.cpp @@ -180,13 +180,13 @@ class BitmapRectView2 : public SampleView { SkRect fLimitR; SkScalar fDX; SkRect fDstR[2]; - + void bounceMe() { SkScalar width = fSrcR.width(); bounce(&fSrcR.fLeft, &fDX, fLimitR.fLeft, fLimitR.fRight - width); fSrcR.fRight = fSrcR.fLeft + width; } - + public: BitmapRectView2() { make_big_bitmap(&fBitmap); @@ -209,7 +209,7 @@ public: fDstR[1] = fDstR[0]; fDstR[1].offset(0, fDstR[0].height() * 5/4); } - + protected: // overrides from SkEventSink virtual bool onQuery(SkEvent* evt) { @@ -219,8 +219,8 @@ protected: } return this->INHERITED::onQuery(evt); } - - virtual void onDrawContent(SkCanvas* canvas) { + + virtual void onDrawContent(SkCanvas* canvas) { SkPaint paint; paint.setStyle(SkPaint::kStroke_Style); paint.setColor(SK_ColorYELLOW); @@ -230,11 +230,11 @@ protected: canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR[i], &paint); canvas->drawRect(fDstR[i], paint); } - + this->bounceMe(); this->inval(NULL); } - + private: typedef SkView INHERITED; }; diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 1bb3a45..7d55c3c 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1597,13 +1597,13 @@ void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, if (NULL == paint) { paint = lazy.init(); } - + LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type) - + while (iter.next()) { iter.fDevice->drawBitmapRect(iter, bitmap, src, dst, looper.paint()); } - + LOOPER_END } diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp index fb126db..a2cfe21 100644 --- a/src/core/SkDevice.cpp +++ b/src/core/SkDevice.cpp @@ -355,11 +355,11 @@ void SkDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, SkMatrix matrix; SkRect bitmapBounds, tmpSrc, tmpDst; SkBitmap tmpBitmap; - + bitmapBounds.set(0, 0, SkIntToScalar(bitmap.width()), SkIntToScalar(bitmap.height())); - + // Compute matrix from the two rectangles if (src) { tmpSrc = *src; @@ -367,10 +367,10 @@ void SkDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, tmpSrc = bitmapBounds; } matrix.setRectToRect(tmpSrc, dst, SkMatrix::kFill_ScaleToFit); - + const SkRect* dstPtr = &dst; const SkBitmap* bitmapPtr = &bitmap; - + // clip the tmpSrc to the bounds of the bitmap, and recompute dstRect if // needed (if the src was clipped). No check needed if src==null. if (src) { @@ -382,7 +382,7 @@ void SkDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, matrix.mapRect(&tmpDst, tmpSrc); dstPtr = &tmpDst; } - + // since we may need to clamp to the borders of the src rect within // the bitmap, we extract a subset. SkIRect srcIR; @@ -391,7 +391,7 @@ void SkDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, return; } bitmapPtr = &tmpBitmap; - + // Since we did an extract, we need to adjust the matrix accordingly SkScalar dx = 0, dy = 0; if (srcIR.fLeft > 0) { @@ -404,7 +404,7 @@ void SkDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, matrix.preTranslate(dx, dy); } } - + // construct a shader, so we can call drawRect with the dst SkShader* s = SkShader::CreateBitmapShader(*bitmapPtr, SkShader::kClamp_TileMode, diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 4858041..322748e 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -1611,7 +1611,7 @@ void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, } matrix.setRectToRect(tmpSrc, dst, SkMatrix::kFill_ScaleToFit); } - + // ensure that src is "valid" before we pass it to our internal routines // and to SkDevice. i.e. sure it is contained inside the original bitmap. SkIRect isrcStorage; -- 2.7.4