blob: c461c091fc9f17a1ada5acb93068024385859dce [file] [log] [blame]
Hal Canary87515122019-03-15 14:22:51 -04001#if 0 // Disabled until updated to use current API.
2// Copyright 2019 Google LLC.
3// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Mike Kleinc0bd9f92019-04-23 12:05:21 -05004#include "tools/fiddle/examples.h"
Hal Canary87515122019-03-15 14:22:51 -04005// HASH=80856fe921ce36f8d5a32d8672bccbfc
Hal Canarya7181e7c2019-03-18 16:06:34 -04006REG_FIDDLE(Image_refEncodedData, 256, 256, false, 3) {
Hal Canary87515122019-03-15 14:22:51 -04007void draw(SkCanvas* canvas) {
8 struct {
9 const char* name;
10 sk_sp<SkImage> image;
11 } tests[] = { { "image", image }, { "bitmap", SkImage::MakeFromBitmap(source) },
12 { "texture", SkImage::MakeFromTexture(canvas->getGrContext(), backEndTexture,
13 kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType,
14 kOpaque_SkAlphaType, nullptr) } };
15 SkString string;
16 SkPaint paint;
17 for (const auto& test : tests ) {
18 if (!test.image) {
19 string.printf("no %s", test.name);
20 } else {
21 string.printf("%s" "encoded %s", test.image->refEncodedData() ? "" : "no ", test.name);
22 }
23 canvas->drawString(string, 10, 20, paint);
24 canvas->translate(0, 20);
25 }
26}
27} // END FIDDLE
28#endif // Disabled until updated to use current API.