14dc791bc4
This reverts commit74b83a4ea9
. Reason for revert: Flutter is updated Original change's description: > Revert "Migrate SkImage::MakeFromTexture to GrRecordingContext" > > This reverts commitdaa9e7455d
. > > Reason for revert: Broke Build-Debian9-Clang-arm-Release-Flutter_Android_Docker > > Original change's description: > > Migrate SkImage::MakeFromTexture to GrRecordingContext > > > > Android migration landed in Android CL 12234077 > > Chrome migration is landing in Chrome CL 2335812 > > > > Note: makeFromCompressedTexture is not used by Chrome. > > > > Bug: skia:104662 > > Change-Id: Ibbe6d412cf22e87188926383d10b21f780208e48 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305102 > > Commit-Queue: Adlai Holler <adlai@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Auto-Submit: Adlai Holler <adlai@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com > > Change-Id: I570945521c6cd78dfeea81e492b7e2b31dd0e6f5 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:104662 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308505 > Reviewed-by: Adlai Holler <adlai@google.com> > Commit-Queue: Adlai Holler <adlai@google.com> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:104662 Change-Id: Ie1d7fd9e597e6e6e5bd91bec086e83a8c1f45a37 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309321 Reviewed-by: Adlai Holler <adlai@google.com> Commit-Queue: Adlai Holler <adlai@google.com> Auto-Submit: Adlai Holler <adlai@google.com>
52 lines
2.6 KiB
C++
52 lines
2.6 KiB
C++
/*
|
|
* Copyright 2015 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
// This is an example of the translation unit that needs to be
|
|
// assembled by the fiddler program to compile into a fiddle: an
|
|
// implementation of the GetDrawOptions() and draw() functions.
|
|
|
|
#include "tools/fiddle/fiddle_main.h"
|
|
DrawOptions GetDrawOptions() {
|
|
// path *should* be absolute.
|
|
static const char path[] = "resources/images/color_wheel.png";
|
|
return DrawOptions(256, 256, true, true, true, true, true, false, false, path,
|
|
GrMipmapped::kYes, 64, 64, 0, GrMipmapped::kYes);
|
|
}
|
|
void draw(SkCanvas* canvas) {
|
|
canvas->clear(SK_ColorWHITE);
|
|
SkMatrix matrix;
|
|
matrix.setScale(0.75f, 0.75f);
|
|
matrix.preRotate(frame * 30.0f * duration); // If an animation, rotate at 30 deg/s.
|
|
SkPaint paint;
|
|
paint.setShader(image->makeShader(SkTileMode::kRepeat, SkTileMode::kRepeat, &matrix));
|
|
canvas->drawPaint(paint);
|
|
SkDebugf("This is text output: %d", 2);
|
|
|
|
if (auto dContext = GrAsDirectContext(canvas->recordingContext())) {
|
|
sk_sp<SkImage> tmp = SkImage::MakeFromTexture(dContext,
|
|
backEndTexture,
|
|
kTopLeft_GrSurfaceOrigin,
|
|
kRGBA_8888_SkColorType,
|
|
kOpaque_SkAlphaType,
|
|
nullptr);
|
|
|
|
// TODO: this sampleCnt parameter here should match that set in the options!
|
|
sk_sp<SkSurface> tmp2 = SkSurface::MakeFromBackendTexture(dContext,
|
|
backEndTextureRenderTarget,
|
|
kTopLeft_GrSurfaceOrigin,
|
|
0, kRGBA_8888_SkColorType,
|
|
nullptr, nullptr);
|
|
|
|
// Note: this surface should only be renderable (i.e., not textureable)
|
|
sk_sp<SkSurface> tmp3 = SkSurface::MakeFromBackendRenderTarget(dContext,
|
|
backEndRenderTarget,
|
|
kTopLeft_GrSurfaceOrigin,
|
|
kRGBA_8888_SkColorType,
|
|
nullptr, nullptr);
|
|
}
|
|
}
|