switch fiddle examples to call MakeFromTexture with RGBA
R=brianosman@google.com
Docs-Preview: https://skia.org/?cl=133063
Bug: skia:6898
Change-Id: I4fe3c8a2bdf71c851109f01f1b3c121f63421339
NOTRY=true
Reviewed-on: https://skia-review.googlesource.com/133063
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
diff --git a/docs/SkImage_Reference.bmh b/docs/SkImage_Reference.bmh
index a6a623f..ce42a15 100644
--- a/docs/SkImage_Reference.bmh
+++ b/docs/SkImage_Reference.bmh
@@ -399,7 +399,7 @@
int x = 0;
for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin } ) {
sk_sp<SkImage> image = SkImage::MakeFromTexture(context, backEndTexture,
- origin, kN32_SkColorType, kOpaque_SkAlphaType, nullptr);
+ origin, kRGBA_8888_SkColorType, kOpaque_SkAlphaType, nullptr);
canvas->drawImage(image, x, 0);
x += 512;
}
@@ -1270,8 +1270,8 @@
};
sk_sp<SkImage> bitmapImage(SkImage::MakeFromBitmap(source));
sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr));
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr));
drawImage(image, "image");
canvas->translate(image->width(), 0);
drawImage(bitmapImage, "source");
@@ -1321,8 +1321,8 @@
};
sk_sp<SkImage> bitmapImage(SkImage::MakeFromBitmap(source));
sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr));
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr));
drawImage(image, "image");
canvas->translate(image->width(), 0);
drawImage(bitmapImage, "source");
@@ -1717,8 +1717,8 @@
sk_sp<SkImage> image;
} tests[] = { { "image", image }, { "bitmap", SkImage::MakeFromBitmap(source) },
{ "texture", SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr) } };
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr) } };
SkString string;
SkPaint paint;
for (const auto& test : tests ) {
@@ -1759,8 +1759,8 @@
sk_sp<SkImage> image;
} tests[] = { { "image", image }, { "bitmap", SkImage::MakeFromBitmap(source) },
{ "texture", SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr) } };
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr) } };
SkString string;
SkPaint paint;
for (const auto& test : tests ) {
@@ -1841,8 +1841,8 @@
sk_sp<SkImage> bitmapImage(SkImage::MakeFromBitmap(source));
GrContext* context = canvas->getGrContext();
sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(context, backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr));
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr));
drawImage(image, context, "image");
canvas->translate(image->width(), 0);
drawImage(bitmapImage, context, "source");
@@ -1883,8 +1883,8 @@
};
sk_sp<SkImage> bitmapImage(SkImage::MakeFromBitmap(source));
sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr));
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr));
drawImage(image, "image");
canvas->translate(image->width(), 0);
drawImage(bitmapImage, "source");
@@ -1926,8 +1926,8 @@
};
sk_sp<SkImage> bitmapImage(SkImage::MakeFromBitmap(source));
sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr));
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr));
drawImage(image, "image");
canvas->translate(image->width(), 0);
drawImage(bitmapImage, "source");
@@ -2117,8 +2117,7 @@
#Return true if Bitmap was created ##
-#NoExample
-#Bug 8051
+#Example
#Image 4
#Platform gpu
SkBitmap bitImage;
@@ -2130,8 +2129,8 @@
return;
}
sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(grContext, backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr));
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr));
canvas->drawImage(textureImage, 45, 45);
if (textureImage->asLegacyBitmap(&bitImage, SkImage::kRO_LegacyBitmapMode)) {
canvas->drawBitmap(bitImage, 90, 90);
@@ -2203,8 +2202,8 @@
};
sk_sp<SkImage> bitmapImage(SkImage::MakeFromBitmap(source));
sk_sp<SkImage> textureImage(SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
- kTopLeft_GrSurfaceOrigin, kN32_SkColorType, kOpaque_SkAlphaType,
- nullptr));
+ kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
+ kOpaque_SkAlphaType, nullptr));
drawImage(image, "image");
canvas->translate(image->width(), 0);
drawImage(bitmapImage, "source");