diff options
-rw-r--r-- | bench/BitmapRectBench.cpp | 2 | ||||
-rw-r--r-- | bench/GameBench.cpp | 6 | ||||
-rw-r--r-- | gm/bitmaprect.cpp | 12 | ||||
-rw-r--r-- | gm/drawbitmaprect.cpp | 25 | ||||
-rw-r--r-- | gm/tallstretchedbitmaps.cpp | 2 | ||||
-rw-r--r-- | gm/verylargebitmap.cpp | 2 | ||||
-rw-r--r-- | gyp/skia_for_android_framework_defines.gypi | 1 | ||||
-rw-r--r-- | include/core/SkCanvas.h | 22 | ||||
-rw-r--r-- | samplecode/SampleApp.cpp | 2 | ||||
-rw-r--r-- | samplecode/SampleBitmapRect.cpp | 4 | ||||
-rw-r--r-- | samplecode/SampleTextureDomain.cpp | 7 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 14 | ||||
-rwxr-xr-x | src/effects/SkTestImageFilters.cpp | 2 | ||||
-rw-r--r-- | src/gpu/SkGr.cpp | 2 | ||||
-rw-r--r-- | src/utils/SkNinePatch.cpp | 4 | ||||
-rw-r--r-- | src/utils/debugger/SkDrawCommand.cpp | 2 | ||||
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 2 | ||||
-rw-r--r-- | tests/PictureTest.cpp | 8 | ||||
-rw-r--r-- | tests/SurfaceTest.cpp | 2 |
19 files changed, 50 insertions, 71 deletions
diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp index 596c18f5a9..d3a7574e04 100644 --- a/bench/BitmapRectBench.cpp +++ b/bench/BitmapRectBench.cpp @@ -96,7 +96,7 @@ protected: paint.setAlpha(fAlpha); for (int i = 0; i < loops; i++) { - canvas->drawBitmapRect(fBitmap, &fSrcR, fDstR, &paint); + canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR, &paint); } } diff --git a/bench/GameBench.cpp b/bench/GameBench.cpp index 3d9885f692..d9a397e190 100644 --- a/bench/GameBench.cpp +++ b/bench/GameBench.cpp @@ -204,11 +204,11 @@ protected: 4, verts, uvs, NULL, NULL, indices, 6, p2); } else { - canvas->drawBitmapRect(fAtlas, src, dst, &p, - SkCanvas::kFast_SrcRectConstraint); + canvas->drawBitmapRect(fAtlas, &src, dst, &p, + SkCanvas::kBleed_DrawBitmapRectFlag); } } else { - canvas->drawBitmapRect(fCheckerboard, dst, &p); + canvas->drawBitmapRect(fCheckerboard, NULL, dst, &p); } } } diff --git a/gm/bitmaprect.cpp b/gm/bitmaprect.cpp index 7e833cb6c8..ff52c15e5d 100644 --- a/gm/bitmaprect.cpp +++ b/gm/bitmaprect.cpp @@ -73,7 +73,7 @@ protected: canvas->drawBitmapRect(bitmap, &srcR, dstR, &paint, SkCanvas::kStrict_SrcRectConstraint); } else { - canvas->drawBitmapRect(bitmap, src[i], dstR, &paint); + canvas->drawBitmapRect(bitmap, &src[i], dstR, &paint); } canvas->drawRect(dstR, paint); @@ -143,7 +143,7 @@ protected: SkRect srcR = { 0.5f, 0.5f, 2.5f, 2.5f }; SkRect dstR = { 100, 100, 300, 200 }; - canvas->drawBitmapRect(bitmap, &srcR, dstR, NULL); + canvas->drawBitmapRectToRect(bitmap, &srcR, dstR, NULL); } private: @@ -213,16 +213,16 @@ protected: SkRect dstR2 = { 10, 410, 30, 430 }; if (!fUseIRect) { - canvas->drawBitmapRect(fBigBitmap, &srcR1, dstR1, &paint); - canvas->drawBitmapRect(fBigBitmap, &srcR2, dstR2, &paint); + canvas->drawBitmapRectToRect(fBigBitmap, &srcR1, dstR1, &paint); + canvas->drawBitmapRectToRect(fBigBitmap, &srcR2, dstR2, &paint); } else { SkIRect iSrcR1, iSrcR2; srcR1.roundOut(&iSrcR1); srcR2.roundOut(&iSrcR2); - canvas->drawBitmapRect(fBigBitmap, iSrcR1, dstR1, &paint); - canvas->drawBitmapRect(fBigBitmap, iSrcR2, dstR2, &paint); + canvas->drawBitmapRect(fBigBitmap, &iSrcR1, dstR1, &paint); + canvas->drawBitmapRect(fBigBitmap, &iSrcR2, dstR2, &paint); } } diff --git a/gm/drawbitmaprect.cpp b/gm/drawbitmaprect.cpp index 9db5ca71da..715f45b904 100644 --- a/gm/drawbitmaprect.cpp +++ b/gm/drawbitmaprect.cpp @@ -79,25 +79,30 @@ static SkImage* makebm(SkBitmap* bm, int w, int h) { return image_from_bitmap(*bm); } -static void canvasproc(SkCanvas* canvas, SkImage*, const SkBitmap& bm, const SkIRect& srcR, +static void canvasproc(SkCanvas* canvas, SkImage*, const SkBitmap& bm, const SkIRect* srcR, const SkRect& dstR) { - canvas->drawBitmapRect(bm, srcR, dstR, NULL); + canvas->drawBitmapRect(bm, srcR, dstR); } -static void imageproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect& srcR, +static void imageproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect* srcIR, const SkRect& dstR) { - canvas->drawImageRect(image, srcR, dstR, NULL); + SkRect storage, *srcR = NULL; + if (srcIR) { + storage.set(*srcIR); + srcR = &storage; + } + canvas->drawImageRect(image, srcR, dstR); } -static void imagescaleproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect& srcIR, +static void imagescaleproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, const SkIRect* srcIR, const SkRect& dstR) { const int newW = SkScalarRoundToInt(dstR.width()); const int newH = SkScalarRoundToInt(dstR.height()); - SkAutoTUnref<SkImage> newImage(image->newImage(newW, newH, &srcIR)); + SkAutoTUnref<SkImage> newImage(image->newImage(newW, newH, srcIR)); #ifdef SK_DEBUG const SkIRect baseR = SkIRect::MakeWH(image->width(), image->height()); - const bool containsSubset = baseR.contains(srcIR); + const bool containsSubset = !srcIR || baseR.contains(*srcIR); #endif if (newImage) { @@ -116,7 +121,7 @@ static void imagescaleproc(SkCanvas* canvas, SkImage* image, const SkBitmap&, co } } -typedef void DrawRectRectProc(SkCanvas*, SkImage*, const SkBitmap&, const SkIRect&, const SkRect&); +typedef void DrawRectRectProc(SkCanvas*, SkImage*, const SkBitmap&, const SkIRect*, const SkRect&); static const int gSize = 1024; static const int gBmpSize = 2048; @@ -176,7 +181,7 @@ protected: for (int h = 1; h <= kMaxSrcRectSize; h *= 4) { SkIRect srcRect = SkIRect::MakeXYWH((gBmpSize - w) / 2, (gBmpSize - h) / 2, w, h); - fProc(canvas, fImage, fLargeBitmap, srcRect, dstRect); + fProc(canvas, fImage, fLargeBitmap, &srcRect, dstRect); SkString label; label.appendf("%d x %d", w, h); @@ -221,7 +226,7 @@ protected: SkBlurMaskFilter::kHighQuality_BlurFlag | SkBlurMaskFilter::kIgnoreTransform_BlurFlag); paint.setMaskFilter(mf)->unref(); - canvas->drawBitmapRect(bm, srcRect, dstRect, &paint); + canvas->drawBitmapRect(bm, &srcRect, dstRect, &paint); } } diff --git a/gm/tallstretchedbitmaps.cpp b/gm/tallstretchedbitmaps.cpp index 4581f10ac2..424aa3a94f 100644 --- a/gm/tallstretchedbitmaps.cpp +++ b/gm/tallstretchedbitmaps.cpp @@ -88,7 +88,7 @@ protected: SkRect dstRect = SkRect::MakeWH(SkIntToScalar(bmp.width()), 10.f * itemHeight); SkPaint paint; paint.setFilterQuality(kLow_SkFilterQuality); - canvas->drawBitmapRect(bmp, subRect, dstRect, &paint); + canvas->drawBitmapRect(bmp, &subRect, dstRect, &paint); canvas->translate(SkIntToScalar(bmp.width() + 10), 0); } } diff --git a/gm/verylargebitmap.cpp b/gm/verylargebitmap.cpp index 0dca1d7be6..753786b97e 100644 --- a/gm/verylargebitmap.cpp +++ b/gm/verylargebitmap.cpp @@ -45,7 +45,7 @@ static void show_bm(SkCanvas* canvas, int width, int height, SkColor colors[2]) r.offset(SkIntToScalar(150), 0); // exercises extract bitmap, but not shader - canvas->drawBitmapRect(bm, ir, r, NULL); + canvas->drawBitmapRect(bm, &ir, r, NULL); canvas->drawRect(r, paint); r.offset(SkIntToScalar(150), 0); diff --git a/gyp/skia_for_android_framework_defines.gypi b/gyp/skia_for_android_framework_defines.gypi index 928d73cbd7..8545551932 100644 --- a/gyp/skia_for_android_framework_defines.gypi +++ b/gyp/skia_for_android_framework_defines.gypi @@ -21,7 +21,6 @@ 'SK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS', 'SK_SUPPORT_LEGACY_SCALAR_DIV', 'SK_SUPPORT_LEGACY_ONDRAWIMAGERECT', - 'SK_SUPPORT_LEGACY_DRAWBITMAPRECTFLAGS_TYPE', ], }, } diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 299ef45d28..05f64dfe33 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -35,7 +35,7 @@ class SkTextBlob; class GrContext; class GrRenderTarget; -//#define SK_SUPPORT_LEGACY_DRAWBITMAPRECTFLAGS_TYPE +//#define SK_SUPPORT_LEGACY_ONDRAWIMAGERECT class SkCanvasState; @@ -834,10 +834,11 @@ public: * @param constraint Control the tradeoff between speed and exactness w.r.t. the src-rect. */ void drawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint = kStrict_SrcRectConstraint); + const SkPaint* paint, SrcRectConstraint); - void drawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst) { - this->drawImageRect(image, src, dst, NULL, kStrict_SrcRectConstraint); + void drawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, + const SkPaint* paint = NULL) { + this->drawImageRect(image, src, dst, paint, kStrict_SrcRectConstraint); } void drawImageRect(const SkImage* image, const SkRect& dst, const SkPaint* paint = NULL) { @@ -845,9 +846,6 @@ public: this->drawImageRect(image, NULL, dst, paint, kStrict_SrcRectConstraint); } - void drawImageRect(const SkImage* image, const SkIRect& isrc, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint = kStrict_SrcRectConstraint); - /** * Draw the image stretched differentially to fit into dst. * center is a rect within the image, and logically divides the image @@ -895,22 +893,13 @@ public: * @param paint The paint used to draw the bitmap, or NULL * @param constraint Control the tradeoff between speed and exactness w.r.t. the src-rect. */ -#ifdef SK_SUPPORT_LEGACY_DRAWBITMAPRECTFLAGS_TYPE void drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, SrcRectConstraint); -#else - void drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint = kStrict_SrcRectConstraint); -#endif void drawBitmapRect(const SkBitmap& bitmap, const SkRect& dst, const SkPaint* paint = NULL) { this->drawBitmapRect(bitmap, NULL, dst, paint, kStrict_SrcRectConstraint); } - void drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint = kStrict_SrcRectConstraint); - -#ifdef SK_SUPPORT_LEGACY_DRAWBITMAPRECTFLAGS_TYPE // IMPORTANT that thse be value-equal with SrcRectConstraint (during transition period) enum DrawBitmapRectFlags { kNone_DrawBitmapRectFlag = 0x0, @@ -945,7 +934,6 @@ public: } this->drawBitmapRectToRect(bitmap, realSrcPtr, dst, paint, flags); } -#endif /** * Draw the bitmap stretched differentially to fit into dst. diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 508ff63052..a80ccd95b8 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -1116,7 +1116,7 @@ void SampleWindow::showZoomer(SkCanvas* canvas) { // Clear the background behind our zoomed in view paint.setColor(SK_ColorWHITE); canvas->drawRect(dest, paint); - canvas->drawBitmapRect(bitmap, src, dest, NULL); + canvas->drawBitmapRect(bitmap, &src, dest); paint.setColor(SK_ColorBLACK); paint.setStyle(SkPaint::kStroke_Style); // Draw a border around the pixel in the middle diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp index b6e629c9f7..123bfb8b12 100644 --- a/samplecode/SampleBitmapRect.cpp +++ b/samplecode/SampleBitmapRect.cpp @@ -131,7 +131,7 @@ protected: for (int i = 0; i < 2; ++i) { paint.setFilterQuality(1 == i ? kLow_SkFilterQuality : kNone_SkFilterQuality); - canvas->drawBitmapRect(bitmap, &srcR, fDstR[i], &paint); + canvas->drawBitmapRectToRect(bitmap, &srcR, fDstR[i], &paint); canvas->drawRect(fDstR[i], paint); } } @@ -225,7 +225,7 @@ protected: for (int i = 0; i < 2; ++i) { paint.setFilterQuality(1 == i ? kLow_SkFilterQuality : kNone_SkFilterQuality); - canvas->drawBitmapRect(fBitmap, &fSrcR, fDstR[i], &paint); + canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR[i], &paint); canvas->drawRect(fDstR[i], paint); } } diff --git a/samplecode/SampleTextureDomain.cpp b/samplecode/SampleTextureDomain.cpp index c798f42922..2794a06956 100644 --- a/samplecode/SampleTextureDomain.cpp +++ b/samplecode/SampleTextureDomain.cpp @@ -53,7 +53,7 @@ protected: // the constrained texture domain. srcRect.setXYWH(1, 1, 3, 3); dstRect.setXYWH(5, 5, 305, 305); - canvas->drawBitmapRect(fBM, &srcRect, dstRect, &paint); + canvas->drawBitmapRectToRect(fBM, &srcRect, dstRect, &paint); // Test that bitmap draws across separate devices also respect // the constrainted texture domain. @@ -64,7 +64,8 @@ protected: srcRect.setXYWH(1, 1, 3, 3); dstRect.setXYWH(1, 1, 3, 3); - surface->getCanvas()->drawBitmapRect(fBM, &srcRect, dstRect, &paint); + surface->getCanvas()->drawBitmapRectToRect(fBM, &srcRect, dstRect, + &paint); SkAutoTUnref<SkImage> image(surface->newImageSnapshot()); @@ -97,7 +98,7 @@ protected: dstRect.setXYWH(-150, -150, 300, 300); canvas->translate(550, 550); canvas->rotate(45); - canvas->drawBitmapRect(fBM, dstRect, &paint); + canvas->drawBitmapRectToRect(fBM, NULL, dstRect, &paint); } private: typedef SkView INHERITED; diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 570435869b..403a12d6a2 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -1853,12 +1853,6 @@ void SkCanvas::drawImageRect(const SkImage* image, const SkRect* src, const SkRe this->onDrawImageRect(image, src, dst, paint SRC_RECT_CONSTRAINT_ARG(constraint)); } -void SkCanvas::drawImageRect(const SkImage* image, const SkIRect& isrc, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint constraint) { - SkRect src = SkRect::Make(isrc); - this->drawImageRect(image, &src, dst, paint, constraint); -} - void SkCanvas::drawImageNine(const SkImage* image, const SkIRect& center, const SkRect& dst, const SkPaint* paint) { if (dst.isEmpty()) { @@ -1877,7 +1871,6 @@ void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, cons this->onDrawBitmap(bitmap, dx, dy, paint); } -#ifdef SK_SUPPORT_LEGACY_DRAWBITMAPRECTFLAGS_TYPE void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, DrawBitmapRectFlags flags) { if (bitmap.drawsNothing() || dst.isEmpty()) { @@ -1885,7 +1878,6 @@ void SkCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, c } this->onDrawBitmapRect(bitmap, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE)flags); } -#endif void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint, SrcRectConstraint constraint) { @@ -1895,12 +1887,6 @@ void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, const S this->onDrawBitmapRect(bitmap, src, dst, paint, (SK_VIRTUAL_CONSTRAINT_TYPE)constraint); } -void SkCanvas::drawBitmapRect(const SkBitmap& bitmap, const SkIRect& isrc, const SkRect& dst, - const SkPaint* paint, SrcRectConstraint constraint) { - SkRect src = SkRect::Make(isrc); - this->drawBitmapRect(bitmap, &src, dst, paint, constraint); -} - void SkCanvas::drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, const SkRect& dst, const SkPaint* paint) { if (bitmap.drawsNothing() || dst.isEmpty()) { diff --git a/src/effects/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp index cd277ec225..ea5560fe21 100755 --- a/src/effects/SkTestImageFilters.cpp +++ b/src/effects/SkTestImageFilters.cpp @@ -71,7 +71,7 @@ bool SkDownSampleImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src, SkRect r = SkRect::MakeWH(SkIntToScalar(src.width()), SkIntToScalar(src.height())); - canvas.drawBitmapRect(tmp, r); + canvas.drawBitmapRect(tmp, NULL, r, NULL); *result = dev->accessBitmap(false); } return true; diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp index 3334095a95..bb04131245 100644 --- a/src/gpu/SkGr.cpp +++ b/src/gpu/SkGr.cpp @@ -529,7 +529,7 @@ static SkBitmap stretch_on_cpu(const SkBitmap& bmp, const Stretch& stretch) { break; } SkRect dstRect = SkRect::MakeWH(SkIntToScalar(stretch.fWidth), SkIntToScalar(stretch.fHeight)); - canvas.drawBitmapRect(bmp, dstRect, &paint); + canvas.drawBitmapRectToRect(bmp, NULL, dstRect, &paint); return stretched; } diff --git a/src/utils/SkNinePatch.cpp b/src/utils/SkNinePatch.cpp index 4a5308bb07..ce8d4801c6 100644 --- a/src/utils/SkNinePatch.cpp +++ b/src/utils/SkNinePatch.cpp @@ -136,7 +136,7 @@ void SkNinePatch::DrawMesh(SkCanvas* canvas, const SkRect& bounds, const int numYStretch = (numYDivs + 1) >> 1; if (numXStretch < 1 && numYStretch < 1) { - canvas->drawBitmapRect(bitmap, bounds, paint); + canvas->drawBitmapRect(bitmap, NULL, bounds, paint); return; } @@ -293,7 +293,7 @@ static void drawNineViaRects(SkCanvas* canvas, const SkRect& dst, s.fRight = srcX[x+1]; d.fLeft = dstX[x]; d.fRight = dstX[x+1]; - canvas->drawBitmapRect(bitmap, s, d, paint); + canvas->drawBitmapRect(bitmap, &s, d, paint); } } } diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp index 1d28d2e8e0..5f0f74ffc0 100644 --- a/src/utils/debugger/SkDrawCommand.cpp +++ b/src/utils/debugger/SkDrawCommand.cpp @@ -129,7 +129,7 @@ void render_bitmap(SkCanvas* canvas, const SkBitmap& input, const SkRect* srcRec yScale * input.height()); canvas->clear(0xFFFFFFFF); - canvas->drawBitmapRect(input, dst); + canvas->drawBitmapRect(input, NULL, dst); if (srcRect) { SkRect r = SkRect::MakeLTRB(srcRect->fLeft * xScale + SK_Scalar1, diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 7d8798cc9b..e6d46a751d 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -299,7 +299,7 @@ DEF_TEST(DrawBitmapRect, reporter) { SkIRect srcR = { gWidth, 0, gWidth + 16, 16 }; SkRect dstR = { 0, 0, SkIntToScalar(16), SkIntToScalar(16) }; - canvas.drawBitmapRect(src, srcR, dstR, NULL); + canvas.drawBitmapRect(src, &srcR, dstR, NULL); // ensure that we draw nothing if srcR does not intersect the bitmap REPORTER_ASSERT(reporter, check_for_all_zeros(dst)); diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp index a20ff2728e..ba66286350 100644 --- a/tests/PictureTest.cpp +++ b/tests/PictureTest.cpp @@ -690,7 +690,7 @@ DEF_TEST(PictureRecorder_replay, reporter) { make_bm(&bm, 10, 10, SK_ColorRED, true); r.offset(5.0f, 5.0f); - canvas->drawBitmapRect(bm, r); + canvas->drawBitmapRectToRect(bm, NULL, r); SkAutoTUnref<SkPicture> final(recorder.endRecording()); REPORTER_ASSERT(reporter, final->willPlayBackBitmaps()); @@ -1167,7 +1167,7 @@ static void draw_bitmaps(const SkBitmap bitmap, SkCanvas* canvas) { // Don't care what these record, as long as they're legal. canvas->drawBitmap(bitmap, 0.0f, 0.0f, &paint); - canvas->drawBitmapRect(bitmap, &rect, rect, &paint); + canvas->drawBitmapRectToRect(bitmap, &rect, rect, &paint, SkCanvas::kNone_DrawBitmapRectFlag); canvas->drawBitmapNine(bitmap, irect, rect, &paint); canvas->drawSprite(bitmap, 1, 1); } @@ -1197,8 +1197,8 @@ DEF_TEST(DontOptimizeSaveLayerDrawDrawRestore, reporter) { // This test is from crbug.com/344987. // The commands are: // saveLayer with paint that modifies alpha - // drawBitmapRect - // drawBitmapRect + // drawBitmapRectToRect + // drawBitmapRectToRect // restore // The bug was that this structure was modified so that: // - The saveLayer and restore were eliminated diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index b1e233fa3a..9d0c6459c1 100644 --- a/tests/SurfaceTest.cpp +++ b/tests/SurfaceTest.cpp @@ -691,7 +691,7 @@ static void TestSurfaceCopyOnWrite(skiatest::Reporter* reporter, SurfaceType sur EXPECT_COPY_ON_WRITE(drawRRect(testRRect, testPaint)) EXPECT_COPY_ON_WRITE(drawPath(testPath, testPaint)) EXPECT_COPY_ON_WRITE(drawBitmap(testBitmap, 0, 0)) - EXPECT_COPY_ON_WRITE(drawBitmapRect(testBitmap, testRect)) + EXPECT_COPY_ON_WRITE(drawBitmapRect(testBitmap, NULL, testRect)) EXPECT_COPY_ON_WRITE(drawBitmapNine(testBitmap, testIRect, testRect, NULL)) EXPECT_COPY_ON_WRITE(drawSprite(testBitmap, 0, 0, NULL)) EXPECT_COPY_ON_WRITE(drawText(testText.c_str(), testText.size(), 0, 1, testPaint)) |