Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Image_dimensions.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=96b4bc43b3667df9ba9e2dafb770d33c
5REG_FIDDLE(Image_dimensions, 256, 256, true, 4) {
6void draw(SkCanvas* canvas) {
7 SkISize dimensions = image->dimensions();
8 SkIRect bounds = image->bounds();
9 SkIRect dimensionsAsBounds = SkIRect::MakeSize(dimensions);
10 SkDebugf("dimensionsAsBounds %c= bounds\n", dimensionsAsBounds == bounds ? '=' : '!');
11}
12} // 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
SkISize dimensions() const
Definition SkImage.h:297
SkIRect bounds() const
Definition SkImage.h:303
sk_sp< SkImage > image
Definition examples.cpp:29
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
static constexpr SkIRect MakeSize(const SkISize &size)
Definition SkRect.h:66