Lines Matching refs:canvas
19 static void drawJpeg(SkCanvas* canvas, const SkISize& size) { in drawJpeg() argument
29 SkAutoCanvasRestore acr(canvas, true); in drawJpeg()
30 canvas->scale(size.width() * 1.0f / image->width(), in drawJpeg()
32 canvas->drawImage(image, 0, 0, NULL); in drawJpeg()
40 SkCanvas* canvas = surface->getCanvas(); in drawContents() local
49 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint); in drawContents()
54 canvas->drawCircle(size.fWidth/2, size.fHeight/2, radius, paint); in drawContents()
57 static void test_surface(SkCanvas* canvas, SkSurface* surf, bool usePaint) { in test_surface() argument
79 canvas->drawImage(imgR, 0, 0, usePaint ? &paint : NULL); in test_surface()
80 canvas->drawImage(imgG, 0, 80, usePaint ? &paint : NULL); in test_surface()
81 surf->draw(canvas, 0, 160, usePaint ? &paint : NULL); in test_surface()
95 canvas->drawImageRect(imgR, &src1, dst1, usePaint ? &paint : NULL); in test_surface()
96 canvas->drawImageRect(imgG, &src2, dst2, usePaint ? &paint : NULL); in test_surface()
97 canvas->drawImageRect(imgR, &src3, dst3, usePaint ? &paint : NULL); in test_surface()
98 canvas->drawImageRect(imgG, NULL, dst4, usePaint ? &paint : NULL); in test_surface()
133 void onDraw(SkCanvas* canvas) override { in onDraw() argument
134 drawJpeg(canvas, this->getISize()); in onDraw()
136 canvas->scale(2, 2); in onDraw()
155 canvas->drawText(kLabel1, strlen(kLabel1), 10, 60, textPaint); in onDraw()
156 canvas->drawText(kLabel2, strlen(kLabel2), 10, 140, textPaint); in onDraw()
157 canvas->drawText(kLabel3, strlen(kLabel3), 10, 220, textPaint); in onDraw()
158 canvas->drawText(kLabel4, strlen(kLabel4), 10, 300, textPaint); in onDraw()
159 canvas->drawText(kLabel5, strlen(kLabel5), 10, 380, textPaint); in onDraw()
160 canvas->drawText(kLabel6, strlen(kLabel6), 10, 460, textPaint); in onDraw()
161 canvas->drawText(kLabel7, strlen(kLabel7), 10, 540, textPaint); in onDraw()
163 canvas->drawText(kLabel8, strlen(kLabel8), 80, 10, textPaint); in onDraw()
164 canvas->drawText(kLabel9, strlen(kLabel9), 160, 10, textPaint); in onDraw()
165 canvas->drawText(kLabel10, strlen(kLabel10), 265, 10, textPaint); in onDraw()
167 canvas->translate(80, 20); in onDraw()
178 surf2.reset(SkSurface::NewRenderTarget(canvas->getGrContext(), in onDraw()
182 test_surface(canvas, surf0, true); in onDraw()
183 canvas->translate(80, 0); in onDraw()
184 test_surface(canvas, surf1, true); in onDraw()
186 canvas->translate(80, 0); in onDraw()
187 test_surface(canvas, surf2, true); in onDraw()
209 void drawIntoImage(SkCanvas* canvas) { in drawIntoImage() argument
220 canvas->drawCircle(x, y, r, paint); in drawIntoImage()
224 SkImage* makeImage(SkCanvas* canvas) { in makeImage() argument
226 SkAutoTUnref<SkSurface> surface(canvas->newSurface(info)); in makeImage()
234 void drawResized(SkCanvas* canvas, SkImage* image, int newW, int newH, const SkIRect* subset, in drawResized() argument
244 canvas->drawImageRect(image, subset ? &srcR : NULL, dstR, &paint); in drawResized()
245 canvas->translate(newW + 20.0f, 0); in drawResized()
249 canvas->drawImage(image2, 0, 0, NULL); in drawResized()
250 canvas->translate(image2->width() + 20.0f, 0); in drawResized()
253 void drawImage(SkCanvas* canvas, SkImage* image, SkFilterQuality fq) { in drawImage() argument
255 canvas->drawImage(image, 0, 0, NULL); in drawImage()
256 canvas->translate(image->width() + 20.0f, 0); in drawImage()
257 this->drawResized(canvas, image, image->width()*4/10, image->height()*4/10, NULL, fq); in drawImage()
260 this->drawResized(canvas, image, W, H, &subset, fq); in drawImage()
263 void onDraw(SkCanvas* canvas) override { in onDraw() argument
264 canvas->translate(10, 10); in onDraw()
266 SkAutoTUnref<SkImage> image(this->makeImage(canvas)); in onDraw()
276 SkAutoCanvasRestore acr(canvas, true); in onDraw()
277 this->drawImage(canvas, image, fq[i]); in onDraw()
279 canvas->translate(0, image->height() + 20.0f); in onDraw()