diff --git a/docs/examples/ImageInfo_computeByteSize.cpp b/docs/examples/ImageInfo_computeByteSize.cpp index 13986e1f57..47f4f43bf8 100644 --- a/docs/examples/ImageInfo_computeByteSize.cpp +++ b/docs/examples/ImageInfo_computeByteSize.cpp @@ -14,6 +14,6 @@ void draw(SkCanvas* canvas) { bitmap.eraseColor(SK_ColorRED); canvas->scale(50, 50); canvas->rotate(8); - canvas->drawBitmap(bitmap, 2, 0); + canvas->drawImage(bitmap.asImage(), 2, 0); } } // END FIDDLE diff --git a/docs/examples/ImageInfo_computeMinByteSize.cpp b/docs/examples/ImageInfo_computeMinByteSize.cpp index deb326f60e..43a2f4189d 100644 --- a/docs/examples/ImageInfo_computeMinByteSize.cpp +++ b/docs/examples/ImageInfo_computeMinByteSize.cpp @@ -14,6 +14,6 @@ void draw(SkCanvas* canvas) { bitmap.eraseColor(SK_ColorRED); canvas->scale(50, 50); canvas->rotate(8); - canvas->drawBitmap(bitmap, 2, 0); + canvas->drawImage(bitmap.asImage(), 2, 0); } } // END FIDDLE diff --git a/docs/examples/ImageInfo_computeOffset.cpp b/docs/examples/ImageInfo_computeOffset.cpp index ad7e1d6875..efa2bbe0cf 100644 --- a/docs/examples/ImageInfo_computeOffset.cpp +++ b/docs/examples/ImageInfo_computeOffset.cpp @@ -17,12 +17,14 @@ void draw(SkCanvas* canvas) { bitmap.installPixels(imageInfo, (void*) pixels, sizeof(pixels[0])); SkPaint paint; paint.setColor(SK_ColorRED); - canvas->drawBitmapRect(bitmap, SkRect::MakeWH(8, 8), SkRect::MakeWH(32, 32), &paint); + canvas->drawImageRect(bitmap.asImage(), SkRect::MakeWH(8, 8), SkRect::MakeWH(32, 32), + SkSamplingOptions(), &paint, SkCanvas::kStrict_SrcRectConstraint); size_t offset = imageInfo.computeOffset(2, 3, sizeof(pixels[0])); pixels[0][offset] = 0x7F; offset = imageInfo.computeOffset(5, 3, sizeof(pixels[0])); pixels[0][offset] = 0x7F; bitmap.installPixels(imageInfo, (void*) pixels, sizeof(pixels[0])); - canvas->drawBitmapRect(bitmap, SkRect::MakeWH(8, 8), SkRect::MakeWH(128, 128), &paint); + canvas->drawImageRect(bitmap.asImage(), SkRect::MakeWH(8, 8), SkRect::MakeWH(128, 128), + SkSamplingOptions(), &paint, SkCanvas::kStrict_SrcRectConstraint); } } // END FIDDLE diff --git a/docs/examples/ImageInfo_makeAlphaType.cpp b/docs/examples/ImageInfo_makeAlphaType.cpp deleted file mode 100644 index f6b408ffdd..0000000000 --- a/docs/examples/ImageInfo_makeAlphaType.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 Google LLC. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -#include "tools/fiddle/examples.h" -// HASH=e72db006f1bea26feceaef8727ff9818 -REG_FIDDLE(ImageInfo_makeAlphaType, 256, 256, false, 3) { -void draw(SkCanvas* canvas) { - const int width = 256; - const int height = 128; - SkColor pixels[height][width]; - for (int y = 0; y < height; ++y) { - for (int x = 0; x < width; ++x) { - int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f))); - int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f))); - int green = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 2 + y) * 0.05f))); - int alpha = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 1 + y) * 0.006f))); - pixels[y][x] = - SkColorSetARGB(alpha, red * alpha / 255, green * alpha / 255, blue * alpha / 255); - } - } - SkBitmap bitmap; - SkImageInfo info = SkImageInfo::Make(width, height, kBGRA_8888_SkColorType, kPremul_SkAlphaType); - bitmap.installPixels(info, (void*) pixels, sizeof(SkColor) * width); - canvas->drawBitmap(source, 0, 0); - canvas->drawBitmap(bitmap, 0, 0); - SkImageInfo unpremulInfo = info.makeAlphaType(kUnpremul_SkAlphaType); - bitmap.installPixels(unpremulInfo, (void*) pixels, sizeof(SkColor) * width); - canvas->drawBitmap(bitmap, 0, 128); -} -} // END FIDDLE diff --git a/docs/examples/ImageInfo_makeColorType.cpp b/docs/examples/ImageInfo_makeColorType.cpp deleted file mode 100644 index 019c483c88..0000000000 --- a/docs/examples/ImageInfo_makeColorType.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2019 Google LLC. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -#include "tools/fiddle/examples.h" -// HASH=3ac267b08b12dc83c95f91d8dd5d70ee -REG_FIDDLE(ImageInfo_makeColorType, 256, 256, false, 0) { -void draw(SkCanvas* canvas) { - const int width = 256; - const int height = 128; - SkColor pixels[height][width]; - for (int y = 0; y < height; ++y) { - for (int x = 0; x < width; ++x) { - int red = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 4 + y) * 0.03f))); - int blue = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 3 + y) * 0.04f))); - int green = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarSin((x * 2 + y) * 0.05f))); - int alpha = SkScalarRoundToInt(255 * SkScalarAbs(SkScalarCos((x * 1 + y) * 0.006f))); - pixels[y][x] = - SkColorSetARGB(alpha, red * alpha / 255, green * alpha / 255, blue * alpha / 255); - } - } - SkBitmap bitmap; - SkImageInfo info = SkImageInfo::Make(width, height, kBGRA_8888_SkColorType, kPremul_SkAlphaType); - bitmap.installPixels(info, (void*) pixels, sizeof(SkColor) * width); - canvas->drawBitmap(source, 0, 0); - canvas->drawBitmap(bitmap, 0, 0); - SkImageInfo rgbaInfo = info.makeColorType(kRGBA_8888_SkColorType); - bitmap.installPixels(rgbaInfo, (void*) pixels, sizeof(SkColor) * width); - canvas->drawBitmap(bitmap, 0, 128); -} -} // END FIDDLE diff --git a/docs/examples/ImageInfo_makeWH.cpp b/docs/examples/ImageInfo_makeWH.cpp index dd58053526..aadc9405e0 100644 --- a/docs/examples/ImageInfo_makeWH.cpp +++ b/docs/examples/ImageInfo_makeWH.cpp @@ -6,13 +6,15 @@ REG_FIDDLE(ImageInfo_makeWH, 256, 144, false, 3) { void draw(SkCanvas* canvas) { SkImageInfo canvasImageInfo = canvas->imageInfo(); SkRect canvasBounds = SkRect::Make(canvasImageInfo.bounds()); - canvas->drawBitmapRect(source, source.bounds(), canvasBounds, nullptr); + canvas->drawImageRect(image, SkRect::Make(source.bounds()), canvasBounds, SkSamplingOptions(), + nullptr, SkCanvas::kStrict_SrcRectConstraint); SkImageInfo insetImageInfo = canvasImageInfo.makeWH(canvasBounds.width() / 2, canvasBounds.height() / 2); SkBitmap inset; inset.allocPixels(insetImageInfo); SkCanvas offscreen(inset); - offscreen.drawBitmapRect(source, source.bounds(), SkRect::Make(inset.bounds()), nullptr); - canvas->drawBitmap(inset, canvasBounds.width() / 4, canvasBounds.height() / 4); + offscreen.drawImageRect(image, SkRect::Make(source.bounds()), SkRect::Make(inset.bounds()), + SkSamplingOptions(), nullptr, SkCanvas::kStrict_SrcRectConstraint); + canvas->drawImage(inset.asImage(), canvasBounds.width() / 4, canvasBounds.height() / 4); } } // END FIDDLE diff --git a/docs/examples/Image_MakeRasterCopy.cpp b/docs/examples/Image_MakeRasterCopy.cpp index 4be49e8a64..210f1ca518 100644 --- a/docs/examples/Image_MakeRasterCopy.cpp +++ b/docs/examples/Image_MakeRasterCopy.cpp @@ -16,7 +16,7 @@ void draw(SkCanvas* canvas) { sk_sp image = SkImage::MakeRasterCopy(pixmap); *pixmap.writable_addr8(2, 2) = 0x00; canvas->scale(10, 10); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); canvas->drawImage(image, 10, 0); } } // END FIDDLE diff --git a/docs/examples/Image_readPixels.cpp b/docs/examples/Image_readPixels.cpp index e3d31c09ef..d0818c36d1 100644 --- a/docs/examples/Image_readPixels.cpp +++ b/docs/examples/Image_readPixels.cpp @@ -16,7 +16,7 @@ void draw(SkCanvas* canvas) { SkPixmap dstPixmap(info, &dstPixels.front(), width * 4); SkBitmap bitmap; bitmap.installPixels(dstPixmap); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } canvas->translate(48, 0); } diff --git a/docs/examples/Image_readPixels_2.cpp b/docs/examples/Image_readPixels_2.cpp index 018710e5ba..2bb7a3e0ea 100644 --- a/docs/examples/Image_readPixels_2.cpp +++ b/docs/examples/Image_readPixels_2.cpp @@ -21,6 +21,6 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; bitmap.installPixels(SkImageInfo::MakeN32Premul(image->width(), image->height()), &srcPixels.front(), rowBytes); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_063.cpp b/docs/examples/Matrix_063.cpp index 14a7d48ee2..0be25b54dd 100644 --- a/docs/examples/Matrix_063.cpp +++ b/docs/examples/Matrix_063.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_063, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.postScale(1, 0.5f); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_Concat.cpp b/docs/examples/Matrix_Concat.cpp index 5b49b6e38b..ce34ff9a9a 100644 --- a/docs/examples/Matrix_Concat.cpp +++ b/docs/examples/Matrix_Concat.cpp @@ -6,11 +6,11 @@ REG_FIDDLE(Matrix_Concat, 256, 64, false, 4) { void draw(SkCanvas* canvas) { SkMatrix matrix, matrix2; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix2.setPolyToPoly(perspect, bitmapBounds, 4); SkMatrix concat = SkMatrix::Concat(matrix, matrix2); canvas->concat(concat); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_MakeScale.cpp b/docs/examples/Matrix_MakeScale.cpp index 166b8de49b..626950fe4d 100644 --- a/docs/examples/Matrix_MakeScale.cpp +++ b/docs/examples/Matrix_MakeScale.cpp @@ -5,6 +5,6 @@ REG_FIDDLE(Matrix_MakeScale, 256, 256, false, 4) { void draw(SkCanvas* canvas) { canvas->concat(SkMatrix::Scale(4, 3)); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_MakeScale_2.cpp b/docs/examples/Matrix_MakeScale_2.cpp deleted file mode 100644 index 8fbdcd1dc8..0000000000 --- a/docs/examples/Matrix_MakeScale_2.cpp +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2019 Google LLC. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -#include "tools/fiddle/examples.h" -// HASH=2956aeb50fa862cdb13995e1e56a4bc8 -REG_FIDDLE(Matrix_MakeScale_2, 256, 256, false, 4) { -void draw(SkCanvas* canvas) { - canvas->concat(SkMatrix::Scale(4, 4)); - canvas->drawBitmap(source, 0, 0); -} -} // END FIDDLE diff --git a/docs/examples/Matrix_MakeTrans.cpp b/docs/examples/Matrix_MakeTrans.cpp index 93896dad35..eef712e23c 100644 --- a/docs/examples/Matrix_MakeTrans.cpp +++ b/docs/examples/Matrix_MakeTrans.cpp @@ -6,7 +6,7 @@ REG_FIDDLE(Matrix_MakeTrans, 256, 256, false, 4) { void draw(SkCanvas* canvas) { SkMatrix matrix = SkMatrix::Translate(64, 48); for (int i = 0; i < 4; ++i) { - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); canvas->concat(matrix); } } diff --git a/docs/examples/Matrix_mapXY_2.cpp b/docs/examples/Matrix_mapXY_2.cpp index 62d03859c7..770b7e59f5 100644 --- a/docs/examples/Matrix_mapXY_2.cpp +++ b/docs/examples/Matrix_mapXY_2.cpp @@ -17,6 +17,6 @@ void draw(SkCanvas* canvas) { } } canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_postConcat.cpp b/docs/examples/Matrix_postConcat.cpp index 790149e3bf..92ea196e9c 100644 --- a/docs/examples/Matrix_postConcat.cpp +++ b/docs/examples/Matrix_postConcat.cpp @@ -10,6 +10,6 @@ void draw(SkCanvas* canvas) { matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.postConcat(matrix); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_postRotate.cpp b/docs/examples/Matrix_postRotate.cpp index 734e144379..2e8f955bd8 100644 --- a/docs/examples/Matrix_postRotate.cpp +++ b/docs/examples/Matrix_postRotate.cpp @@ -10,6 +10,6 @@ void draw(SkCanvas* canvas) { matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.postRotate(45, source.width() / 2, source.height() / 2); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_postRotate_2.cpp b/docs/examples/Matrix_postRotate_2.cpp index 2da4c92e5c..ff45690c92 100644 --- a/docs/examples/Matrix_postRotate_2.cpp +++ b/docs/examples/Matrix_postRotate_2.cpp @@ -10,6 +10,6 @@ void draw(SkCanvas* canvas) { matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.postRotate(45); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_postScale.cpp b/docs/examples/Matrix_postScale.cpp index f77efaae9b..0d8e18c846 100644 --- a/docs/examples/Matrix_postScale.cpp +++ b/docs/examples/Matrix_postScale.cpp @@ -10,6 +10,6 @@ void draw(SkCanvas* canvas) { matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.postScale(.75f, 1.5f, source.width() / 2, source.height() / 2); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_postScale_2.cpp b/docs/examples/Matrix_postScale_2.cpp index 7d3024e4ef..1beca7e5b5 100644 --- a/docs/examples/Matrix_postScale_2.cpp +++ b/docs/examples/Matrix_postScale_2.cpp @@ -10,6 +10,6 @@ void draw(SkCanvas* canvas) { matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.postScale(.75f, 1.5f); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_postSkew.cpp b/docs/examples/Matrix_postSkew.cpp index a1b5756d7c..5bb78b6772 100644 --- a/docs/examples/Matrix_postSkew.cpp +++ b/docs/examples/Matrix_postSkew.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_postSkew, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); - matrix.postSkew(.5f, 0, source.width() / 2, source.height() / 2); + matrix.postSkew(.5f, 0, image->width() / 2, image->height() / 2); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_postSkew_2.cpp b/docs/examples/Matrix_postSkew_2.cpp index 233405c196..565795802c 100644 --- a/docs/examples/Matrix_postSkew_2.cpp +++ b/docs/examples/Matrix_postSkew_2.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_postSkew_2, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.postSkew(.5f, 0); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_preConcat.cpp b/docs/examples/Matrix_preConcat.cpp index 09e8e24e53..d92413d3cb 100644 --- a/docs/examples/Matrix_preConcat.cpp +++ b/docs/examples/Matrix_preConcat.cpp @@ -11,6 +11,6 @@ void draw(SkCanvas* canvas) { matrix2.setPolyToPoly(perspect, bitmapBounds, 4); matrix.preConcat(matrix2); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_preRotate.cpp b/docs/examples/Matrix_preRotate.cpp index e5d4b4833e..49e84c1b75 100644 --- a/docs/examples/Matrix_preRotate.cpp +++ b/docs/examples/Matrix_preRotate.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_preRotate, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); - matrix.preRotate(45, source.width() / 2, source.height() / 2); + matrix.preRotate(45, image->width() / 2, image->height() / 2); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_preRotate_2.cpp b/docs/examples/Matrix_preRotate_2.cpp index 81054154fa..6b10a3c97b 100644 --- a/docs/examples/Matrix_preRotate_2.cpp +++ b/docs/examples/Matrix_preRotate_2.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_preRotate_2, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.preRotate(45); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_preScale.cpp b/docs/examples/Matrix_preScale.cpp index 0c67cb4bd6..df20b64085 100644 --- a/docs/examples/Matrix_preScale.cpp +++ b/docs/examples/Matrix_preScale.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_preScale, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); - matrix.preScale(.75f, 1.5f, source.width() / 2, source.height() / 2); + matrix.preScale(.75f, 1.5f, image->width() / 2, image->height() / 2); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_preScale_2.cpp b/docs/examples/Matrix_preScale_2.cpp index a69885eb7e..7ee5dfc21f 100644 --- a/docs/examples/Matrix_preScale_2.cpp +++ b/docs/examples/Matrix_preScale_2.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_preScale_2, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.preScale(.75f, 1.5f); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_preSkew.cpp b/docs/examples/Matrix_preSkew.cpp index 6548412c67..f4eab2f381 100644 --- a/docs/examples/Matrix_preSkew.cpp +++ b/docs/examples/Matrix_preSkew.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_preSkew, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); - matrix.preSkew(.5f, 0, source.width() / 2, source.height() / 2); + matrix.preSkew(.5f, 0, image->width() / 2, image->height() / 2); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_preSkew_2.cpp b/docs/examples/Matrix_preSkew_2.cpp index 1819caf5d4..c3882df9e8 100644 --- a/docs/examples/Matrix_preSkew_2.cpp +++ b/docs/examples/Matrix_preSkew_2.cpp @@ -6,10 +6,10 @@ REG_FIDDLE(Matrix_preSkew_2, 256, 256, false, 3) { void draw(SkCanvas* canvas) { SkMatrix matrix; SkPoint bitmapBounds[4], perspect[4] = {{50, 10}, {180, 40}, {236, 176}, {10, 206}}; - SkRect::Make(source.bounds()).toQuad(bitmapBounds); + SkRect::Make(image->bounds()).toQuad(bitmapBounds); matrix.setPolyToPoly(bitmapBounds, perspect, 4); matrix.preSkew(.5f, 0); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_set9.cpp b/docs/examples/Matrix_set9.cpp index 8d117d0e17..f726698f66 100644 --- a/docs/examples/Matrix_set9.cpp +++ b/docs/examples/Matrix_set9.cpp @@ -8,6 +8,6 @@ void draw(SkCanvas* canvas) { SkScalar buffer[9] = {4, 0, 3, 0, 5, 4, 0, 0, 1}; m.set9(buffer); canvas->concat(m); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_setConcat.cpp b/docs/examples/Matrix_setConcat.cpp index c877d3daf8..2c15ee4ad8 100644 --- a/docs/examples/Matrix_setConcat.cpp +++ b/docs/examples/Matrix_setConcat.cpp @@ -11,6 +11,6 @@ void draw(SkCanvas* canvas) { matrix2.setPolyToPoly(perspect, bitmapBounds, 4); matrix.setConcat(matrix, matrix2); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Matrix_setPerspX.cpp b/docs/examples/Matrix_setPerspX.cpp index d9b6b9a2d3..5a86f8a8b1 100644 --- a/docs/examples/Matrix_setPerspX.cpp +++ b/docs/examples/Matrix_setPerspX.cpp @@ -10,7 +10,7 @@ void draw(SkCanvas* canvas) { matrix.setPerspX(perspX); canvas->save(); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); canvas->restore(); canvas->translate(64, 64); } diff --git a/docs/examples/Matrix_setPerspY.cpp b/docs/examples/Matrix_setPerspY.cpp index 0542e4a221..fb75faadf1 100644 --- a/docs/examples/Matrix_setPerspY.cpp +++ b/docs/examples/Matrix_setPerspY.cpp @@ -10,7 +10,7 @@ void draw(SkCanvas* canvas) { matrix.setPerspY(perspX); canvas->save(); canvas->concat(matrix); - canvas->drawBitmap(source, 0, 0); + canvas->drawImage(image, 0, 0); canvas->restore(); canvas->translate(64, 64); } diff --git a/docs/examples/Paint_setStyle.cpp b/docs/examples/Paint_setStyle.cpp index 0f8dba4ea7..64ffab3270 100644 --- a/docs/examples/Paint_setStyle.cpp +++ b/docs/examples/Paint_setStyle.cpp @@ -25,7 +25,7 @@ void draw(SkCanvas* canvas) { canvas->drawLine(10, 10, 60, 60, paint); canvas->drawRect({80, 10, 130, 60}, paint); canvas->drawRegion(region, paint); - canvas->drawBitmap(bitmap, 200, 10, &paint); + canvas->drawImage(bitmap.asImage(), 200, 10, &paint); canvas->translate(0, 80); } } diff --git a/docs/examples/Pixmap_erase.cpp b/docs/examples/Pixmap_erase.cpp index 876ef3c621..498bb24661 100644 --- a/docs/examples/Pixmap_erase.cpp +++ b/docs/examples/Pixmap_erase.cpp @@ -12,6 +12,6 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; canvas->scale(20, 20); bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } // END FIDDLE diff --git a/docs/examples/Pixmap_erase_2.cpp b/docs/examples/Pixmap_erase_2.cpp index 4e029aeeab..54b2779430 100644 --- a/docs/examples/Pixmap_erase_2.cpp +++ b/docs/examples/Pixmap_erase_2.cpp @@ -11,6 +11,6 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; canvas->scale(20, 20); bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } // END FIDDLE diff --git a/docs/examples/Pixmap_erase_3.cpp b/docs/examples/Pixmap_erase_3.cpp index ec2d8e03c3..6b2b939775 100644 --- a/docs/examples/Pixmap_erase_3.cpp +++ b/docs/examples/Pixmap_erase_3.cpp @@ -14,6 +14,6 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; canvas->scale(20, 20); bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(image, 0, 0); } } // END FIDDLE diff --git a/docs/examples/Pixmap_extractSubset.cpp b/docs/examples/Pixmap_extractSubset.cpp index 51e6ed45ec..9489824539 100644 --- a/docs/examples/Pixmap_extractSubset.cpp +++ b/docs/examples/Pixmap_extractSubset.cpp @@ -13,7 +13,7 @@ void draw(SkCanvas* canvas) { if (pixmap.extractSubset(&inset, {128, 128, 512, 512})) { SkBitmap bitmap; bitmap.installPixels(inset); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } } // END FIDDLE diff --git a/docs/examples/Pixmap_readPixels.cpp b/docs/examples/Pixmap_readPixels.cpp index fdbbdc5d07..f8446c819f 100644 --- a/docs/examples/Pixmap_readPixels.cpp +++ b/docs/examples/Pixmap_readPixels.cpp @@ -19,13 +19,13 @@ void draw(SkCanvas* canvas) { bitmap.installPixels(srcPixmap); SkCanvas srcCanvas(bitmap); srcCanvas.drawRect(SkRect::MakeWH(width, height), paint); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); std::vector dstPixels; dstPixels.resize(height * width * 2); SkImageInfo dstInfo = srcInfo.makeColorType(kARGB_4444_SkColorType); srcPixmap.readPixels(dstInfo, &dstPixels.front(), width * 2); SkPixmap dstPixmap(dstInfo, &dstPixels.front(), width * 2); bitmap.installPixels(dstPixmap); - canvas->drawBitmap(bitmap, 0, 128); + canvas->drawImage(bitmap.asImage(), 0, 128); } } // END FIDDLE diff --git a/docs/examples/Pixmap_readPixels_2.cpp b/docs/examples/Pixmap_readPixels_2.cpp index f08d8f0138..24dcf755af 100644 --- a/docs/examples/Pixmap_readPixels_2.cpp +++ b/docs/examples/Pixmap_readPixels_2.cpp @@ -18,7 +18,7 @@ void draw(SkCanvas* canvas) { SkPixmap dstmap(info, &dstPixels.front(), rowBytes); bitmap.installPixels(dstmap); canvas->translate(32, 32); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } } // END FIDDLE diff --git a/docs/examples/Pixmap_readPixels_3.cpp b/docs/examples/Pixmap_readPixels_3.cpp index 45779e6e4a..f17439c5c4 100644 --- a/docs/examples/Pixmap_readPixels_3.cpp +++ b/docs/examples/Pixmap_readPixels_3.cpp @@ -18,7 +18,7 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; bitmap.installPixels(dstmap); canvas->translate(32, 32); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } } // END FIDDLE diff --git a/docs/examples/Pixmap_readPixels_4.cpp b/docs/examples/Pixmap_readPixels_4.cpp index 7645ef4d90..3d7fd85a60 100644 --- a/docs/examples/Pixmap_readPixels_4.cpp +++ b/docs/examples/Pixmap_readPixels_4.cpp @@ -18,7 +18,7 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; bitmap.installPixels(dstmap); canvas->translate(32, 32); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } } // END FIDDLE diff --git a/docs/examples/Pixmap_reset_2.cpp b/docs/examples/Pixmap_reset_2.cpp index b1434856b1..8249faae70 100644 --- a/docs/examples/Pixmap_reset_2.cpp +++ b/docs/examples/Pixmap_reset_2.cpp @@ -15,7 +15,7 @@ void draw(SkCanvas* canvas) { image->alphaType()), (const void*) &pixels.front(), image->width() * 4); SkBitmap bitmap; bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, x, 0); + canvas->drawImage(bitmap.asImage(), x, 0); x += 128; } } diff --git a/docs/examples/Pixmap_scalePixels.cpp b/docs/examples/Pixmap_scalePixels.cpp index fa7ccf37a3..861498ca3d 100644 --- a/docs/examples/Pixmap_scalePixels.cpp +++ b/docs/examples/Pixmap_scalePixels.cpp @@ -21,7 +21,7 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; bitmap.installPixels(dstmap); canvas->translate(32, 32); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } } // END FIDDLE diff --git a/docs/examples/Pixmap_writable_addr16.cpp b/docs/examples/Pixmap_writable_addr16.cpp index 29d9dcf048..b3c50d3e71 100644 --- a/docs/examples/Pixmap_writable_addr16.cpp +++ b/docs/examples/Pixmap_writable_addr16.cpp @@ -14,9 +14,9 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; bitmap.installPixels(pixmap); canvas->scale(10, 10); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); *pixmap.writable_addr16(2, 2) = 0x000F; bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 10, 0); + canvas->drawImage(bitmap.asImage(), 10, 0); } } // END FIDDLE diff --git a/docs/examples/Pixmap_writable_addr32.cpp b/docs/examples/Pixmap_writable_addr32.cpp index 41886de4ba..81d51df733 100644 --- a/docs/examples/Pixmap_writable_addr32.cpp +++ b/docs/examples/Pixmap_writable_addr32.cpp @@ -19,6 +19,6 @@ void draw(SkCanvas* canvas) { } SkBitmap bitmap; bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } // END FIDDLE diff --git a/docs/examples/Pixmap_writable_addr64.cpp b/docs/examples/Pixmap_writable_addr64.cpp index 779da210b3..e5324961f5 100644 --- a/docs/examples/Pixmap_writable_addr64.cpp +++ b/docs/examples/Pixmap_writable_addr64.cpp @@ -12,9 +12,9 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; canvas->scale(10, 10); bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); *pixmap.writable_addr64(1, 1) |= 0x00ff000000000000LL; bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 10, 0); + canvas->drawImage(bitmap.asImage(), 10, 0); } } // END FIDDLE diff --git a/docs/examples/Pixmap_writable_addr8.cpp b/docs/examples/Pixmap_writable_addr8.cpp index 8c7aa38d71..5b5ce85be8 100644 --- a/docs/examples/Pixmap_writable_addr8.cpp +++ b/docs/examples/Pixmap_writable_addr8.cpp @@ -14,9 +14,9 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; bitmap.installPixels(pixmap); canvas->scale(10, 10); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); *pixmap.writable_addr8(2, 2) = 0; // bitmap.installPixels(pixmap); // uncomment to fix on GPU - canvas->drawBitmap(bitmap, 10, 0); + canvas->drawImage(bitmap.asImage(), 10, 0); } } // END FIDDLE diff --git a/docs/examples/Pixmap_writable_addrF16.cpp b/docs/examples/Pixmap_writable_addrF16.cpp index 7962f30480..c1c5d2717e 100644 --- a/docs/examples/Pixmap_writable_addrF16.cpp +++ b/docs/examples/Pixmap_writable_addrF16.cpp @@ -14,12 +14,12 @@ void draw(SkCanvas* canvas) { SkBitmap bitmap; canvas->scale(20, 20); bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); uint16_t* pixel2 = pixmap.writable_addrF16(0, 1); for (int i = 0; i < 4; ++i) { pixel2[i] = storage[0][i]; } bitmap.installPixels(pixmap); - canvas->drawBitmap(bitmap, 4, 0); + canvas->drawImage(bitmap.asImage(), 4, 0); } } // END FIDDLE diff --git a/docs/examples/Surface_draw.cpp b/docs/examples/Surface_draw.cpp index 4808836838..da89e962ae 100644 --- a/docs/examples/Surface_draw.cpp +++ b/docs/examples/Surface_draw.cpp @@ -13,7 +13,7 @@ void draw(SkCanvas* canvas) { if (big->peekPixels(&pixmap)) { SkBitmap bigBits; bigBits.installPixels(pixmap); - canvas->drawBitmap(bigBits, 0, 0); + canvas->drawImage(bigBits.asImage(), 0, 0); } } } // END FIDDLE diff --git a/docs/examples/Surface_makeSurface.cpp b/docs/examples/Surface_makeSurface.cpp index 8b994b6a1b..293f691020 100644 --- a/docs/examples/Surface_makeSurface.cpp +++ b/docs/examples/Surface_makeSurface.cpp @@ -12,12 +12,12 @@ void draw(SkCanvas* canvas) { if (big->peekPixels(&pixmap)) { SkBitmap bigBits; bigBits.installPixels(pixmap); - canvas->drawBitmap(bigBits, 0, 0); + canvas->drawImage(bigBits.asImage(), 0, 0); } if (lil->peekPixels(&pixmap)) { SkBitmap lilBits; lilBits.installPixels(pixmap); - canvas->drawBitmap(lilBits, 64, 64); + canvas->drawImage(lilBits.asImage(), 64, 64); } } } // END FIDDLE diff --git a/docs/examples/Surface_readPixels_3.cpp b/docs/examples/Surface_readPixels_3.cpp index 58769780d5..ce43994e4a 100644 --- a/docs/examples/Surface_readPixels_3.cpp +++ b/docs/examples/Surface_readPixels_3.cpp @@ -18,6 +18,6 @@ void draw(SkCanvas* canvas) { surf->readPixels(bitmap, x, y); } } - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); } } // END FIDDLE diff --git a/docs/examples/blurbug.cpp b/docs/examples/blurbug.cpp index 4babf82762..6d26f09f04 100644 --- a/docs/examples/blurbug.cpp +++ b/docs/examples/blurbug.cpp @@ -17,7 +17,9 @@ void draw(SkCanvas* canvas) { paint.setMaskFilter(SkMaskFilter::MakeBlur(kSolid_SkBlurStyle, 3)); for (auto color : {SK_ColorRED, SK_ColorBLUE, 0xFF007F00}) { paint.setColor(color); - canvas->drawBitmapRect(bitmap, SkRect::MakeWH(8, 8), SkRect::MakeWH(32, 32), &paint); + canvas->drawImageRect(bitmap.asImage(), SkRect::MakeWH(8, 8), SkRect::MakeWH(32, 32), + SkSamplingOptions(), &paint, + SkCanvas::kStrict_SrcRectConstraint); canvas->translate(48, 0); } } diff --git a/docs/examples/dither1.cpp b/docs/examples/dither1.cpp index 6745aec6a6..bfd55f4582 100644 --- a/docs/examples/dither1.cpp +++ b/docs/examples/dither1.cpp @@ -19,7 +19,7 @@ void draw(SkCanvas* canvas) { } } canvas->scale(8, 8); - canvas->drawBitmap(bm16, 0, 0); + canvas->drawImage(bm16.asImage(), 0, 0); } } // END FIDDLE diff --git a/docs/examples/draw_a8_bitmap.cpp b/docs/examples/draw_a8_bitmap.cpp index 6a45ca1541..56b11d2f25 100644 --- a/docs/examples/draw_a8_bitmap.cpp +++ b/docs/examples/draw_a8_bitmap.cpp @@ -13,6 +13,6 @@ void draw(SkCanvas* canvas) { SkPaint paint; paint.setColor(0xFF00FF00); canvas->clear(0xFF000000); - canvas->drawBitmap(bitmap, 0, 0, &paint); + canvas->drawImage(bitmap.asImage(), 0, 0, SkSamplingOptions(), &paint); } } // END FIDDLE diff --git a/docs/examples/gpu8888diff.cpp b/docs/examples/gpu8888diff.cpp index 1854da5285..73bacce270 100644 --- a/docs/examples/gpu8888diff.cpp +++ b/docs/examples/gpu8888diff.cpp @@ -10,9 +10,9 @@ void draw(SkCanvas* canvas) { bitmap.allocPixels(imageInfo); SkCanvas offscreen(bitmap); offscreen.clear(SK_ColorGREEN); - canvas->drawBitmap(bitmap, 0, 0); + canvas->drawImage(bitmap.asImage(), 0, 0); offscreen.clear(SK_ColorGRAY); - canvas->drawBitmap(bitmap, 2, 2); + canvas->drawImage(bitmap.asImage(), 2, 2); auto pack8888 = [](unsigned a, unsigned r, unsigned g, unsigned b) -> uint32_t { return (a << 24) | (b << 16) | (g << 8) | (r << 0); }; @@ -22,11 +22,11 @@ void draw(SkCanvas* canvas) { pack8888(0xFF, 0x0, 0x0, 0x099), pack8888(0xFF, 0x0, 0x0, 0x055)}; SkPixmap redPixmap(imageInfo, &red8888, 8); if (bitmap.writePixels(redPixmap, 0, 0)) { - canvas->drawBitmap(bitmap, 4, 4); + canvas->drawImage(bitmap.asImage(), 4, 4); } SkPixmap bluePixmap(imageInfo, &blue8888, 8); if (bitmap.writePixels(bluePixmap, 0, 0)) { - canvas->drawBitmap(bitmap, 6, 6); + canvas->drawImage(bitmap.asImage(), 6, 6); } } } // END FIDDLE diff --git a/docs/examples/kLow_SkFilterQuality.cpp b/docs/examples/kLow_SkFilterQuality.cpp deleted file mode 100644 index 119c54ed4e..0000000000 --- a/docs/examples/kLow_SkFilterQuality.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. -#include "tools/fiddle/examples.h" -REG_FIDDLE(kLow_SkFilterQuality, 192, 192, false, 0) { -void draw(SkCanvas* canvas) { - static const uint32_t pixels[9] = { - 0xFFFF0000, 0xFFFFFFFF, 0xFF00FF00, 0xFFFFFFFF, 0xFF000000, - 0xFFFFFFFF, 0xFF808080, 0xFFFFFFFF, 0xFF0000FF, - }; - SkBitmap bm; - bm.installPixels(SkImageInfo::MakeN32Premul(3, 3), (void*)pixels, 12); - bm.setImmutable(); - SkPaint paint; - paint.setFilterQuality(kLow_SkFilterQuality); - // paint.setMaskFilter(SkBlurMaskFilter::Make( - // kNormal_SkBlurStyle, 3.375, SkBlurMaskFilter::kHighQuality_BlurFlag)); - canvas->drawBitmapRect(bm, {64, 64, 128, 128}, &paint); -} -} // END FIDDLE diff --git a/docs/examples/no_gpu_blur.cpp b/docs/examples/no_gpu_blur.cpp index b7d60df040..21aa6bceef 100644 --- a/docs/examples/no_gpu_blur.cpp +++ b/docs/examples/no_gpu_blur.cpp @@ -18,7 +18,7 @@ void draw(SkCanvas* canvas) { SkIPoint offset; bitmap.extractAlpha(&alpha, &paint, nullptr, &offset); paint.setColor(SK_ColorRED); - canvas->drawBitmap(bitmap, 0, -offset.fY, &paint); - canvas->drawBitmap(alpha, 100 + offset.fX, 0, &paint); + canvas->drawImage(bitmap.asImage(), 0, -offset.fY, SkSamplingOptions(), &paint); + canvas->drawImage(alpha.asImage(), 100 + offset.fX, 0, SkSamplingOptions(), &paint); } } // END FIDDLE diff --git a/docs/examples/setimagefilter.cpp b/docs/examples/setimagefilter.cpp index f3638f549f..589a0edb7d 100644 --- a/docs/examples/setimagefilter.cpp +++ b/docs/examples/setimagefilter.cpp @@ -14,7 +14,7 @@ void draw(SkCanvas* canvas) { offscreen.drawString("e", 20, 70, font, paint); paint.setImageFilter(SkImageFilters::PointLitDiffuse( SkPoint3::Make(80, 100, 10), SK_ColorWHITE, 1, 2, nullptr, nullptr)); - canvas->drawBitmap(bitmap, 0, 0, &paint); + canvas->drawImage(bitmap.asImage(), 0, 0, SkSamplingOptions(), &paint); } } // END FIDDLE diff --git a/docs/examples/subset_example.cpp b/docs/examples/subset_example.cpp index 52cc43ccec..96fbda0d25 100644 --- a/docs/examples/subset_example.cpp +++ b/docs/examples/subset_example.cpp @@ -21,7 +21,7 @@ void draw(SkCanvas* canvas) { int y = shuffle[(N * i) + j] / N; SkBitmap subset; source.extractSubset(&subset, SkIRect::MakeXYWH(w * x, h * y, w, h)); - canvas->drawBitmap(subset, w * i, h * j); + canvas->drawImage(subset.asImage(), w * i, h * j); } } } diff --git a/tools/fiddle/all_examples.cpp b/tools/fiddle/all_examples.cpp index 350b3558da..c67b84d8d4 100644 --- a/tools/fiddle/all_examples.cpp +++ b/tools/fiddle/all_examples.cpp @@ -348,9 +348,7 @@ #include "../../docs/examples/ImageInfo_height.cpp" #include "../../docs/examples/ImageInfo_isEmpty.cpp" #include "../../docs/examples/ImageInfo_isOpaque.cpp" -#include "../../docs/examples/ImageInfo_makeAlphaType.cpp" #include "../../docs/examples/ImageInfo_makeColorSpace.cpp" -#include "../../docs/examples/ImageInfo_makeColorType.cpp" #include "../../docs/examples/ImageInfo_makeWH.cpp" #include "../../docs/examples/ImageInfo_minRowBytes.cpp" #include "../../docs/examples/ImageInfo_minRowBytes64.cpp" @@ -414,7 +412,6 @@ #include "../../docs/examples/Matrix_MakeAll.cpp" #include "../../docs/examples/Matrix_MakeRectToRect.cpp" #include "../../docs/examples/Matrix_MakeScale.cpp" -#include "../../docs/examples/Matrix_MakeScale_2.cpp" #include "../../docs/examples/Matrix_MakeTrans.cpp" #include "../../docs/examples/Matrix_ScaleToFit.cpp" #include "../../docs/examples/Matrix_SetAffineIdentity.cpp" @@ -1130,7 +1127,6 @@ #include "../../docs/examples/incomplete.cpp" #include "../../docs/examples/inlinepixmapconstructor.cpp" #include "../../docs/examples/issue640176.cpp" -#include "../../docs/examples/kLow_SkFilterQuality.cpp" #include "../../docs/examples/l_system_plant.cpp" #include "../../docs/examples/maddash.cpp" #include "../../docs/examples/makeRasterImage_fail.cpp"