skia2/docs/examples/Dst.cpp
Mike Reed 9911630fc2 Hide misc non-sampling draw methods
Related chrome CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2646604

Bug: skia:7650
Change-Id: I1069a6151cb70bb6d2c743cf2513f47284c9df7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358221
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2021-01-25 17:54:56 +00:00

18 lines
797 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=35915a2273be1076f00f2e47998ce808
REG_FIDDLE(Dst, 256, 256, false, 3) {
void draw(SkCanvas* canvas) {
SkRSXform xforms[] = { { .5f, 0, 0, 0 }, {0, .5f, 125, 128 } };
SkRect tex[] = { { 0, 0, 250, 250 }, { 0, 0, 250, 250 } };
SkColor colors[] = { 0x7f55aa00, 0x7f3333bf };
SkSamplingOptions sampling;
canvas->drawAtlas(image.get(), xforms, tex, colors, 2, SkBlendMode::kSrc,
sampling, nullptr, nullptr);
canvas->translate(128, 0);
canvas->drawAtlas(image.get(), xforms, tex, colors, 2, SkBlendMode::kDst,
sampling, nullptr, nullptr);
}
} // END FIDDLE