Go to the source code of this file.
|
static void | test_bitmap_equality (skiatest::Reporter *reporter, SkBitmap &bm1, SkBitmap &bm2) |
|
static void | paint_source (SkSurface *sourceSurface) |
|
static void | run_shader_test (skiatest::Reporter *reporter, SkSurface *sourceSurface, SkSurface *destinationSurface, SkImageInfo &info) |
|
| DEF_TEST (ImageNewShader, reporter) |
|
static void | gpu_to_gpu (skiatest::Reporter *reporter, GrRecordingContext *rContext) |
|
static void | raster_to_gpu (skiatest::Reporter *reporter, GrRecordingContext *rContext) |
|
| DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS (ImageNewShader_GPU, reporter, ctxInfo, CtsEnforcement::kApiLevel_T) |
|
| DEF_TEST (ImageRawShader, reporter) |
|
◆ DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS()
Definition at line 143 of file ImageNewShaderTest.cpp.
146 {
147 auto dContext = ctxInfo.directContext();
148
149
151
152
153
154
156}
static void gpu_to_gpu(skiatest::Reporter *reporter, GrRecordingContext *rContext)
static void raster_to_gpu(skiatest::Reporter *reporter, GrRecordingContext *rContext)
◆ DEF_TEST() [1/2]
Definition at line 116 of file ImageNewShaderTest.cpp.
116 {
118
121
123}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static void run_shader_test(skiatest::Reporter *reporter, SkSurface *sourceSurface, SkSurface *destinationSurface, SkImageInfo &info)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)
◆ DEF_TEST() [2/2]
Definition at line 158 of file ImageNewShaderTest.cpp.
158 {
161
162
164
165
167}
#define REPORTER_ASSERT(r, cond,...)
sk_sp< SkShader > makeRawShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
sk_sp< const SkImage > image
static constexpr SkCubicResampler Mitchell()
◆ gpu_to_gpu()
Definition at line 125 of file ImageNewShaderTest.cpp.
125 {
127
130
132}
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
◆ paint_source()
static void paint_source |
( |
SkSurface * |
sourceSurface | ) |
|
|
static |
Definition at line 41 of file ImageNewShaderTest.cpp.
41 {
43 sourceCanvas->
clear(0xFFDEDEDE);
44
48
54
56}
void drawRect(const SkRect &rect, const SkPaint &paint)
void clear(SkColor color)
void setStyle(Style style)
void setColor(SkColor color)
@ kFill_Style
set to fill geometry
sk_sp< SkBlender > blender SkRect rect
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
◆ raster_to_gpu()
◆ run_shader_test()
Definition at line 58 of file ImageNewShaderTest.cpp.
59 {
61
65
67 paint.setShader(sourceShader);
68
72
76
77
81
83
84
87
92
94
96 paintTranslated.
setShader(sourceShaderTranslated);
97
98 destinationCanvas->
drawPaint(paintTranslated);
99
103
104
105 {
106 for (
int y = 0;
y <
info.height();
y++) {
108
109 for (
int x = 1;
x <
info.width();
x++) {
111 }
112 }
113 }
114}
static void paint_source(SkSurface *sourceSurface)
static void test_bitmap_equality(skiatest::Reporter *reporter, SkBitmap &bm1, SkBitmap &bm2)
constexpr SkColor SK_ColorTRANSPARENT
SkColor getColor(int x, int y) const
void allocN32Pixels(int width, int height, bool isOpaque=false)
void drawPaint(const SkPaint &paint)
void setShader(sk_sp< SkShader > shader)
sk_sp< SkImage > makeImageSnapshot()
bool readPixels(const SkPixmap &dst, int srcX, int srcY)
unsigned useCenter Optional< SkMatrix > matrix
SkSamplingOptions(SkFilterMode::kLinear))
◆ test_bitmap_equality()