74 }
else if (
SkString(GM::kErrorMsg_DrawSkippedGpuOnly) == errorMsg) {
104 return fGpuSetupResult;
113 fGraphiteTestContext =
nullptr;
148 return fDrawProc(canvas, errorMsg);
151#if defined(SK_GANESH)
152SkISize SimpleGpuGM::getISize() {
return fSize; }
155 return fDrawProc(rContext, canvas, errorMsg);
186#if defined(SK_GANESH)
188 this->onDraw(rContext, canvas);
199 *errorMsg = kErrorMsg_DrawSkippedGpuOnly;
202 if (rContext->abandoned()) {
203 *errorMsg =
"GrContext abandoned.";
206 return this->onDraw(rContext, canvas, errorMsg);
210template <
typename Fn>
229 paint.setStrokeWidth(2);
246 paint.setStrokeWidth(2);
static const SkColor bgColor
static constexpr uint64_t kOffset
#define SK_ABORT(message,...)
#define SK_PRINTF_LIKE(A, B)
#define SkColorSetRGB(r, g, b)
constexpr SkColor SK_ColorWHITE
@ kUTF8
uses bytes to represent UTF-8 or ASCII
#define TRACE_STR_COPY(str)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
void allocN32Pixels(int width, int height, bool isOpaque=false)
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
virtual GrRecordingContext * recordingContext() const
void drawPaint(const SkPaint &paint)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
SkMatrix & setRotate(SkScalar degrees, SkScalar px, SkScalar py)
@ kStroke_Style
set to stroke geometry
void void void void appendVAList(const char format[], va_list) SK_PRINTF_LIKE(2
const char * c_str() const
DrawResult gpuSetup(SkCanvas *, SkString *errorMsg, GraphiteTestContext *=nullptr)
virtual void onGpuTeardown()
DrawResult drawContent(SkCanvas *canvas)
virtual bool onChar(SkUnichar)
virtual SkISize getISize()=0
virtual void onSetControls(const SkMetaData &)
virtual void onOnceBeforeDraw()
void drawSizeBounds(SkCanvas *, SkColor)
GraphiteTestContext * graphiteTestContext() const
virtual bool runAsBench() const
virtual DrawResult onGpuSetup(SkCanvas *, SkString *, GraphiteTestContext *)
virtual SkString getName() const =0
virtual bool onAnimate(double)
DrawResult draw(SkCanvas *canvas)
virtual bool onGetControls(SkMetaData *)
virtual DrawResult onDraw(SkCanvas *, SkString *errorMsg)
void drawBackground(SkCanvas *)
SkISize getISize() override
SkString getName() const override
uint32_t uint32_t * format
void MarkGMGood(SkCanvas *canvas, SkScalar x, SkScalar y)
static void handle_gm_failure(SkCanvas *canvas, DrawResult result, const SkString &errorMsg)
static void draw_failure_message(SkCanvas *canvas, const char format[],...) SK_PRINTF_LIKE(2
void MarkGMBad(SkCanvas *canvas, SkScalar x, SkScalar y)
static void draw_gpu_only_message(SkCanvas *canvas)
static void mark(SkCanvas *canvas, SkScalar x, SkScalar y, Fn &&fn)
constexpr SkColor4f kWhite
constexpr SkColor4f kTransparent
Optional< SkRect > bounds
font
Font Metadata and Metrics.
void Register(skiagm::GM *gm)
sk_tools::Registry< GMFactory > GMRegistry
static SkRect Make(const SkISize &size)
#define TRACE_EVENT0(category_group, name)
#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val)