aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-01-07 08:15:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-07 08:15:10 -0800
commit0575cb2def2f4dfdad04e0674d0f8eb8e7c24cec (patch)
tree9fc4c73da2ed766a9cab0eee77d67d44233b76d1 /gm
parent983dc2541a729609037a05eba731b3eb9788c517 (diff)
Revert of add backdrop option to SaveLayerRec (patchset #14 id:260001 of https://codereview.chromium.org/1523053003/ )
Reason for revert: serialized != direct, will investigate Original issue's description: > add backdrop option to SaveLayerRec > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1523053003 > > Committed: https://skia.googlesource.com/skia/+/247415969a9a5ed6c83cc09395472416c4b7de7f TBR=robertphillips@google.com,bsalomon@google.com,mtklein@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1565203002
Diffstat (limited to 'gm')
-rw-r--r--gm/imagefilters.cpp74
1 files changed, 0 insertions, 74 deletions
diff --git a/gm/imagefilters.cpp b/gm/imagefilters.cpp
index 951a934d82..5f1ae84949 100644
--- a/gm/imagefilters.cpp
+++ b/gm/imagefilters.cpp
@@ -104,77 +104,3 @@ DEF_SIMPLE_GM(fast_slow_blurimagefilter, canvas, 620, 260) {
canvas->translate(r.width() + 20, 0);
}
}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-#include "Resources.h"
-#include "SkBlurImageFilter.h"
-#include "SkMatrixConvolutionImageFilter.h"
-#include "SkMorphologyImageFilter.h"
-#include "SkColorMatrixFilter.h"
-#include "SkColorFilterImageFilter.h"
-#include "SkRRect.h"
-
-static void draw_set(SkCanvas* canvas, SkImageFilter* filters[], int count) {
- const SkRect r = SkRect::MakeXYWH(30, 30, 200, 200);
- const SkScalar offset = 250;
- SkScalar dx = 0, dy = 0;
-
- for (int i = 0; i < count; ++i) {
- canvas->save();
- SkRRect rr = SkRRect::MakeRectXY(r.makeOffset(dx, dy), 20, 20);
- canvas->clipRRect(rr, SkRegion::kIntersect_Op, true);
- canvas->saveLayer({ &rr.getBounds(), nullptr, filters[i], 0 });
- canvas->drawColor(0x40FFFFFF);
- canvas->restore();
- canvas->restore();
-
- if (0 == dx) {
- dx = offset;
- } else {
- dx = 0;
- dy = offset;
- }
- }
-}
-
-DEF_SIMPLE_GM(savelayer_with_backdrop, canvas, 830, 550) {
- SkColorMatrix cm;
- cm.setSaturation(10);
- SkAutoTUnref<SkColorFilter> cf(SkColorMatrixFilter::Create(cm));
- const SkScalar kernel[] = { 4, 0, 4, 0, -15, 0, 4, 0, 4 };
- SkImageFilter* filters[] = {
- SkBlurImageFilter::Create(10, 10),
- SkDilateImageFilter::Create(8, 8),
- SkMatrixConvolutionImageFilter::Create({ 3, 3 }, kernel, 1, 0, { 0, 0 },
- SkMatrixConvolutionImageFilter::kClampToBlack_TileMode,
- true),
- SkColorFilterImageFilter::Create(cf),
- };
-
- const struct {
- SkScalar fSx, fSy, fTx, fTy;
- } xforms[] = {
- { 1, 1, 0, 0 },
- { 0.5f, 0.5f, 530, 0 },
- { 0.25f, 0.25f, 530, 275 },
- { 0.125f, 0.125f, 530, 420 },
- };
-
- SkPaint paint;
- paint.setFilterQuality(kMedium_SkFilterQuality);
- SkAutoTUnref<SkImage> image(GetResourceAsImage("mandrill_512.png"));
-
- canvas->translate(20, 20);
- for (const auto& xform : xforms) {
- canvas->save();
- canvas->translate(xform.fTx, xform.fTy);
- canvas->scale(xform.fSx, xform.fSy);
- canvas->drawImage(image, 0, 0, &paint);
- draw_set(canvas, filters, SK_ARRAY_COUNT(filters));
- canvas->restore();
- }
-
- for (auto& filter : filters) {
- filter->unref();
- }
-}