aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/fiddle/draw.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-11-16 14:59:48 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-17 12:53:55 +0000
commit57e0828fade9270f1fd3abf32f4e27b108c4bc1a (patch)
tree36cd92d54369d52c615d9071cc0f6f57eb5e27f5 /tools/fiddle/draw.cpp
parentecd62a6cf65ad2a3dcdad8decbe8677f5a74e02a (diff)
Add backend GPU objects to fiddle app
TBR=bsalomon@google.com Change-Id: I8876a4657f837436322150925233e0f36c91e8f0 Reviewed-on: https://skia-review.googlesource.com/72641 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
Diffstat (limited to 'tools/fiddle/draw.cpp')
-rw-r--r--tools/fiddle/draw.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/fiddle/draw.cpp b/tools/fiddle/draw.cpp
index 8e94883313..31aa9d0a81 100644
--- a/tools/fiddle/draw.cpp
+++ b/tools/fiddle/draw.cpp
@@ -26,4 +26,30 @@ void draw(SkCanvas* canvas) {
&matrix));
canvas->drawPaint(paint);
SkDebugf("This is text output: %d", 2);
+
+ GrContext* context = canvas->getGrContext();
+ if (context) {
+ sk_sp<SkImage> tmp = SkImage::MakeFromTexture(context,
+ backEndTexture,
+ kTopLeft_GrSurfaceOrigin,
+ kOpaque_SkAlphaType,
+ nullptr);
+
+ sk_sp<SkSurface> tmp2 = SkSurface::MakeFromBackendTexture(context,
+ backEndTextureRenderTarget,
+ kTopLeft_GrSurfaceOrigin,
+ 0, nullptr, nullptr);
+
+ sk_sp<SkSurface> tmp3 = SkSurface::MakeFromBackendRenderTarget(context,
+ backEndRenderTarget,
+ kTopLeft_GrSurfaceOrigin,
+ nullptr, nullptr);
+
+ sk_sp<SkSurface> tmp4 = SkSurface::MakeFromBackendTextureAsRenderTarget(
+ context,
+ backEndTextureRenderTarget,
+ kTopLeft_GrSurfaceOrigin,
+ 0, nullptr, nullptr);
+ }
+
}