skia2/docs/examples/Canvas_drawAtlas.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

17 lines
713 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=1df575f9b8132306ce0552a2554ed132
REG_FIDDLE(Canvas_drawAtlas, 256, 256, false, 3) {
void draw(SkCanvas* canvas) {
// SkBitmap source = mandrill;
SkRSXform xforms[] = { { .5f, 0, 0, 0 }, {0, .5f, 200, 100 } };
SkRect tex[] = { { 0, 0, 250, 250 }, { 0, 0, 250, 250 } };
SkColor colors[] = { 0x7f55aa00, 0x7f3333bf };
const SkImage* imagePtr = image.get();
SkSamplingOptions sampling;
canvas->drawAtlas(imagePtr, xforms, tex, colors, 2, SkBlendMode::kSrcOver,
sampling, nullptr, nullptr);
}
} // END FIDDLE