skia2/docs/examples/Draw_Looper_Methods.cpp
Robert Phillips 6dc14ded91 Revert "hide drawlooper from paint"
This reverts commit 766b42b7ba.

Reason for revert: afaict this is changing a lot of image filter GMs for the worse

Original change's description:
> hide drawlooper from paint
> 
> Bug: skia: 4783
> 
> Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-22 17:27:17 +00:00

21 lines
844 B
C++

// 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=84ec12a36e50df5ac565cc7a75ffbe9f
REG_FIDDLE(Draw_Looper_Methods, 256, 128, false, 0) {
void draw(SkCanvas* canvas) {
SkLayerDrawLooper::LayerInfo info;
info.fPaintBits = (SkLayerDrawLooper::BitFlags) SkLayerDrawLooper::kColorFilter_Bit;
info.fColorMode = SkBlendMode::kSrc;
SkLayerDrawLooper::Builder looperBuilder;
SkPaint* loopPaint = looperBuilder.addLayer(info);
loopPaint->setColor(SK_ColorRED);
info.fOffset.set(20, 20);
loopPaint = looperBuilder.addLayer(info);
loopPaint->setColor(SK_ColorBLUE);
SkPaint paint;
paint.setDrawLooper(looperBuilder.detach());
canvas->drawCircle(50, 50, 50, paint);
}
} // END FIDDLE