Lines Matching refs:canvas
96 void draw_pass(SkCanvas* canvas, DrawingPass drawingPass) { in draw_pass() argument
100 canvas->save(); in draw_pass()
102 canvas->translate(kMargin, kMargin); in draw_pass()
104 canvas->translate(0, kTitleSpacing); in draw_pass()
108 canvas->save(); in draw_pass()
112 canvas->drawText("Src Unknown", sizeof("Src Unknown") - 1, in draw_pass()
115 canvas->drawText("Src Opaque", sizeof("Src Opaque") - 1, in draw_pass()
121 canvas->translate(0, kSubtitleSpacing + kShapeSpacing/2); in draw_pass()
125 canvas->save(); in draw_pass()
128 this->drawModeName(canvas, mode); in draw_pass()
130 canvas->translate(kLabelSpacing + kShapeSpacing/2, 0); in draw_pass()
134 this->setupShapePaint(canvas, kShapeColors[colorIdx], mode, &paint); in draw_pass()
136 canvas->save(); in draw_pass()
140 canvas->save(); in draw_pass()
141 canvas->clipRect(clipRect); in draw_pass()
143 sk_tool_utils::draw_checkerboard(canvas, 0xffffffff, 0xffc6c3c6, in draw_pass()
147 canvas->drawColor(kBGColor, SkXfermode::kSrc_Mode); in draw_pass()
149 canvas->restore(); in draw_pass()
151 this->drawShape(canvas, static_cast<Shape>(shapeIdx), paint, mode); in draw_pass()
153 canvas->translate(kShapeTypeSpacing, 0); in draw_pass()
156 canvas->restore(); in draw_pass()
157 canvas->translate(kPaintSpacing, 0); in draw_pass()
160 canvas->restore(); in draw_pass()
161 canvas->translate(0, kShapeSpacing); in draw_pass()
164 canvas->restore(); in draw_pass()
165 canvas->translate(kXfermodeTypeSpacing, 0); in draw_pass()
168 canvas->restore(); in draw_pass()
171 void onDraw(SkCanvas* canvas) override { in onDraw() argument
172 draw_pass(canvas, kCheckerboard_Pass); in onDraw()
173 canvas->saveLayer(nullptr, nullptr); in onDraw()
175 canvas->translate(kMargin, kMargin); in onDraw()
176 draw_pass(canvas, kBackground_Pass); in onDraw()
182 canvas->drawText("Porter Duff", sizeof("Porter Duff") - 1, in onDraw()
185 canvas->drawText("Advanced", sizeof("Advanced") - 1, in onDraw()
189 draw_pass(canvas, kShape_Pass); in onDraw()
190 canvas->restore(); in onDraw()
193 void drawModeName(SkCanvas* canvas, SkXfermode::Mode mode) { in drawModeName() argument
197 canvas->drawText(modeName, strlen(modeName), kLabelSpacing - kShapeSize / 4, in drawModeName()
201 void setupShapePaint(SkCanvas* canvas, GrColor color, SkXfermode::Mode mode, SkPaint* paint) { in setupShapePaint() argument
223 canvas->drawRectCoords(-kShapeSpacing/2, -kShapeSpacing/2, in setupShapePaint()
230 void drawShape(SkCanvas* canvas, Shape shape, const SkPaint& paint, SkXfermode::Mode mode) { in drawShape() argument
244 canvas->drawRectCoords(-kShapeSize/2, -kShapeSize/2, kShapeSize/2, kShapeSize/2, in drawShape()
249 canvas->save(); in drawShape()
250 canvas->rotate(45); in drawShape()
251 canvas->drawRectCoords(-kShapeSize/2, -kShapeSize/2, kShapeSize/2, kShapeSize/2, in drawShape()
253 canvas->restore(); in drawShape()
257 canvas->save(); in drawShape()
258 canvas->rotate(static_cast<SkScalar>((511 * mode + 257) % 360)); in drawShape()
259 canvas->drawPath(fOval, shapePaint); in drawShape()
260 canvas->restore(); in drawShape()
264 canvas->drawPath(fConcave, shapePaint); in drawShape()