Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
bug6783.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkImage.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTileMode.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (bug6783, canvas, 500, 500)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( bug6783  ,
canvas  ,
500  ,
500   
)

Definition at line 35 of file bug6783.cpp.

35 {
37
38 SkPaint p;
39 p.setColor(SK_ColorYELLOW);
40 surface->getCanvas()->drawPaint(p);
41 p.setColor(SK_ColorBLUE);
42 surface->getCanvas()->drawRect(SkRect::MakeWH(50, 100), p);
43
44 sk_sp<SkImage> img = surface->makeImageSnapshot();
45
47 m.preSkew(0.5f, 0.5f);
48
49 // The bug was present at all filter levels, but you might not notice it at nearest.
51
52 // It's only important to repeat or mirror in x to show off the bug.
53 p.setShader(img->makeShader(SkTileMode::kRepeat, SkTileMode::kClamp, sampling, m));
54 canvas->drawPaint(p);
55}
constexpr SkColor SK_ColorYELLOW
Definition SkColor.h:139
constexpr SkColor SK_ColorBLUE
Definition SkColor.h:135
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition SkMatrix.h:75
static SkMatrix Translate(SkScalar dx, SkScalar dy)
Definition SkMatrix.h:91
VkSurfaceKHR surface
Definition main.cc:49
SkSamplingOptions sampling
Definition SkRecords.h:337
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)
Definition SkRect.h:609