Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Bitmap_pixelRefOrigin.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4// HASH=6d31686c6c0829c70f284ae716526d6a
5REG_FIDDLE(Bitmap_pixelRefOrigin, 256, 256, true, 3) {
6void draw(SkCanvas* canvas) {
7 SkBitmap subset;
8 source.extractSubset(&subset, SkIRect::MakeXYWH(32, 64, 128, 256));
9 SkIPoint sourceOrigin = source.pixelRefOrigin();
10 SkIPoint subsetOrigin = subset.pixelRefOrigin();
11 SkDebugf("source origin: %d, %d\n", sourceOrigin.fX, sourceOrigin.fY);
12 SkDebugf("subset origin: %d, %d\n", subsetOrigin.fX, subsetOrigin.fY);
13}
14} // END FIDDLE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
SkIPoint pixelRefOrigin() const
Definition SkBitmap.cpp:168
bool extractSubset(SkBitmap *dst, const SkIRect &subset) const
Definition SkBitmap.cpp:453
SkBitmap source
Definition examples.cpp:28
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
int32_t fX
x-axis value
int32_t fY
y-axis value
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
Definition SkRect.h:104