Lines Matching refs:paint
120 DeviceCM(SkBaseDevice* device, const SkPaint* paint, SkCanvas* canvas, in DeviceCM()
131 fPaint = paint ? SkNEW_ARGS(SkPaint, (*paint)) : NULL; in DeviceCM()
311 static SkColorFilter* image_to_color_filter(const SkPaint& paint) { in image_to_color_filter() argument
312 SkImageFilter* imgf = paint.getImageFilter(); in image_to_color_filter()
322 SkColorFilter* paintCF = paint.getColorFilter(); in image_to_color_filter()
336 AutoDrawLooper(SkCanvas* canvas, const SkSurfaceProps& props, const SkPaint& paint, in AutoDrawLooper() argument
338 const SkRect* bounds = NULL) : fOrigPaint(paint) { in AutoDrawLooper()
348 SkPaint* paint = set_if_needed(&fLazyPaintInit, fOrigPaint); in AutoDrawLooper() local
349 paint->setColorFilter(simplifiedCF)->unref(); in AutoDrawLooper()
350 paint->setImageFilter(NULL); in AutoDrawLooper()
351 fPaint = paint; in AutoDrawLooper()
379 if (SkDrawLooper* looper = paint.getLooper()) { in AutoDrawLooper()
390 uint32_t oldFlags = paint.getFlags(); in AutoDrawLooper()
393 SkPaint* paint = set_if_needed(&fLazyPaintInit, fOrigPaint); in AutoDrawLooper() local
394 paint->setFlags(fNewPaintFlags); in AutoDrawLooper()
395 fPaint = paint; in AutoDrawLooper()
407 const SkPaint& paint() const { in paint() function in AutoDrawLooper
446 SkPaint* paint = fLazyPaintPerLooper.set(fLazyPaintInit.isValid() ? in doNext() local
448 paint->setFlags(fNewPaintFlags); in doNext()
451 paint->setImageFilter(NULL); in doNext()
452 paint->setXfermode(NULL); in doNext()
455 if (fLooperContext && !fLooperContext->next(fCanvas, paint)) { in doNext()
460 if (!fFilter->filter(paint, drawType)) { in doNext()
469 fPaint = paint; in doNext()
486 #define LOOPER_BEGIN_DRAWDEVICE(paint, type) \ argument
488 AutoDrawLooper looper(this, fProps, paint, true); \
492 #define LOOPER_BEGIN(paint, type, bounds) \ argument
494 AutoDrawLooper looper(this, fProps, paint, false, bounds); \
969 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint) { in saveLayer() argument
973 SaveLayerStrategy strategy = this->willSaveLayer(bounds, paint, kARGB_ClipLayer_SaveFlag); in saveLayer()
975 this->internalSaveLayer(bounds, paint, kARGB_ClipLayer_SaveFlag, strategy); in saveLayer()
979 int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags) { in saveLayer() argument
983 SaveLayerStrategy strategy = this->willSaveLayer(bounds, paint, flags); in saveLayer()
985 this->internalSaveLayer(bounds, paint, flags, strategy); in saveLayer()
989 void SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags, in internalSaveLayer() argument
1002 if (!this->clipRectBounds(bounds, flags, &ir, paint ? paint->getImageFilter() : NULL)) { in internalSaveLayer()
1014 if (paint) { in internalSaveLayer()
1016 if (paint->getImageFilter() || paint->getColorFilter()) { in internalSaveLayer()
1034 SkBaseDevice* newDev = device->onCreateDevice(createInfo, paint); in internalSaveLayer()
1049 DeviceCM* layer = SkNEW_ARGS(DeviceCM, (device, paint, this, fConservativeRasterClip, in internalSaveLayer()
1181 const SkMatrix& matrix, const SkPaint* paint) { in internalDrawBitmap() argument
1187 if (NULL == paint) { in internalDrawBitmap()
1188 paint = lazy.init(); in internalDrawBitmap()
1195 if (paint && paint->canComputeFastBounds()) { in internalDrawBitmap()
1198 bounds = &paint->computeFastBounds(storage, &storage); in internalDrawBitmap()
1201 LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, bounds) in internalDrawBitmap()
1204 iter.fDevice->drawBitmap(iter, bitmap, matrix, looper.paint()); in internalDrawBitmap()
1211 const SkPaint* paint, bool deviceIsBitmapDevice) { in internalDrawDevice() argument
1213 if (NULL == paint) { in internalDrawDevice()
1214 paint = &tmp; in internalDrawDevice()
1217 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type) in internalDrawDevice()
1220 paint = &looper.paint(); in internalDrawDevice()
1221 SkImageFilter* filter = paint->getImageFilter(); in internalDrawDevice()
1234 SkPaint tmpUnfiltered(*paint); in internalDrawDevice()
1241 dstDev->drawSprite(iter, src, pos.x(), pos.y(), *paint); in internalDrawDevice()
1243 dstDev->drawDevice(iter, srcDev, pos.x(), pos.y(), *paint); in internalDrawDevice()
1249 void SkCanvas::onDrawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint* paint) { in onDrawSprite() argument
1253 this->drawBitmap(bitmap, SkIntToScalar(x), SkIntToScalar(y), paint); in onDrawSprite()
1265 if (NULL == paint) { in onDrawSprite()
1266 paint = &tmp; in onDrawSprite()
1269 LOOPER_BEGIN_DRAWDEVICE(*paint, SkDrawFilter::kBitmap_Type) in onDrawSprite()
1272 paint = &looper.paint(); in onDrawSprite()
1273 SkImageFilter* filter = paint->getImageFilter(); in onDrawSprite()
1285 SkPaint tmpUnfiltered(*paint); in onDrawSprite()
1291 iter.fDevice->drawSprite(iter, bitmap, pos.x(), pos.y(), *paint); in onDrawSprite()
1684 const SkPaint& paint) { in drawDRRect() argument
1690 this->drawRRect(outer, paint); in drawDRRect()
1701 this->onDrawDRRect(outer, inner, paint); in drawDRRect()
1706 void SkCanvas::drawPaint(const SkPaint& paint) { in drawPaint() argument
1707 this->onDrawPaint(paint); in drawPaint()
1710 void SkCanvas::drawRect(const SkRect& r, const SkPaint& paint) { in drawRect() argument
1711 this->onDrawRect(r, paint); in drawRect()
1714 void SkCanvas::drawOval(const SkRect& r, const SkPaint& paint) { in drawOval() argument
1715 this->onDrawOval(r, paint); in drawOval()
1718 void SkCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { in drawRRect() argument
1719 this->onDrawRRect(rrect, paint); in drawRRect()
1722 void SkCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint& paint) { in drawPoints() argument
1723 this->onDrawPoints(mode, count, pts, paint); in drawPoints()
1728 const uint16_t indices[], int indexCount, const SkPaint& paint) { in drawVertices() argument
1730 indices, indexCount, paint); in drawVertices()
1733 void SkCanvas::drawPath(const SkPath& path, const SkPaint& paint) { in drawPath() argument
1734 this->onDrawPath(path, paint); in drawPath()
1737 void SkCanvas::drawImage(const SkImage* image, SkScalar x, SkScalar y, const SkPaint* paint) { in drawImage() argument
1738 this->onDrawImage(image, x, y, paint); in drawImage()
1742 const SkPaint* paint) { in drawImageRect() argument
1746 this->onDrawImageRect(image, src, dst, paint); in drawImageRect()
1749 void SkCanvas::drawBitmap(const SkBitmap& bitmap, SkScalar dx, SkScalar dy, const SkPaint* paint) { in drawBitmap() argument
1753 this->onDrawBitmap(bitmap, dx, dy, paint); in drawBitmap()
1757 const SkPaint* paint, DrawBitmapRectFlags flags) { in drawBitmapRectToRect() argument
1761 this->onDrawBitmapRect(bitmap, src, dst, paint, flags); in drawBitmapRectToRect()
1765 const SkPaint* paint) { in drawBitmapNine() argument
1769 this->onDrawBitmapNine(bitmap, center, dst, paint); in drawBitmapNine()
1772 void SkCanvas::drawSprite(const SkBitmap& bitmap, int left, int top, const SkPaint* paint) { in drawSprite() argument
1776 this->onDrawSprite(bitmap, left, top, paint); in drawSprite()
1789 void SkCanvas::onDrawPaint(const SkPaint& paint) { in onDrawPaint() argument
1791 this->internalDrawPaint(paint); in onDrawPaint()
1794 void SkCanvas::internalDrawPaint(const SkPaint& paint) { in internalDrawPaint() argument
1795 LOOPER_BEGIN(paint, SkDrawFilter::kPaint_Type, NULL) in internalDrawPaint()
1798 iter.fDevice->drawPaint(iter, looper.paint()); in internalDrawPaint()
1805 const SkPaint& paint) { in onDrawPoints() argument
1813 if (paint.canComputeFastBounds()) { in onDrawPoints()
1820 bounds = &paint.computeFastStrokeBounds(r, &storage); in onDrawPoints()
1828 LOOPER_BEGIN(paint, SkDrawFilter::kPoint_Type, bounds) in onDrawPoints()
1831 iter.fDevice->drawPoints(iter, mode, count, pts, looper.paint()); in onDrawPoints()
1837 void SkCanvas::onDrawRect(const SkRect& r, const SkPaint& paint) { in onDrawRect() argument
1841 if (paint.canComputeFastBounds()) { in onDrawRect()
1847 bounds = &paint.computeFastBounds(tmp, &storage); in onDrawRect()
1853 LOOPER_BEGIN(paint, SkDrawFilter::kRect_Type, bounds) in onDrawRect()
1856 iter.fDevice->drawRect(iter, r, looper.paint()); in onDrawRect()
1862 void SkCanvas::onDrawOval(const SkRect& oval, const SkPaint& paint) { in onDrawOval() argument
1866 if (paint.canComputeFastBounds()) { in onDrawOval()
1867 bounds = &paint.computeFastBounds(oval, &storage); in onDrawOval()
1873 LOOPER_BEGIN(paint, SkDrawFilter::kOval_Type, bounds) in onDrawOval()
1876 iter.fDevice->drawOval(iter, oval, looper.paint()); in onDrawOval()
1882 void SkCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { in onDrawRRect() argument
1886 if (paint.canComputeFastBounds()) { in onDrawRRect()
1887 bounds = &paint.computeFastBounds(rrect.getBounds(), &storage); in onDrawRRect()
1895 this->SkCanvas::drawRect(rrect.getBounds(), paint); in onDrawRRect()
1899 this->SkCanvas::drawOval(rrect.getBounds(), paint); in onDrawRRect()
1903 LOOPER_BEGIN(paint, SkDrawFilter::kRRect_Type, bounds) in onDrawRRect()
1906 iter.fDevice->drawRRect(iter, rrect, looper.paint()); in onDrawRRect()
1913 const SkPaint& paint) { in onDrawDRRect() argument
1916 if (paint.canComputeFastBounds()) { in onDrawDRRect()
1917 bounds = &paint.computeFastBounds(outer.getBounds(), &storage); in onDrawDRRect()
1923 LOOPER_BEGIN(paint, SkDrawFilter::kRRect_Type, bounds) in onDrawDRRect()
1926 iter.fDevice->drawDRRect(iter, outer, inner, looper.paint()); in onDrawDRRect()
1932 void SkCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) { in onDrawPath() argument
1940 if (!path.isInverseFillType() && paint.canComputeFastBounds()) { in onDrawPath()
1942 bounds = &paint.computeFastBounds(pathBounds, &storage); in onDrawPath()
1951 this->internalDrawPaint(paint); in onDrawPath()
1956 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, bounds) in onDrawPath()
1959 iter.fDevice->drawPath(iter, path, looper.paint()); in onDrawPath()
1965 void SkCanvas::onDrawImage(const SkImage* image, SkScalar x, SkScalar y, const SkPaint* paint) { in onDrawImage() argument
1969 if (NULL == paint || paint->canComputeFastBounds()) { in onDrawImage()
1970 if (paint) { in onDrawImage()
1971 paint->computeFastBounds(bounds, &bounds); in onDrawImage()
1979 if (NULL == paint) { in onDrawImage()
1980 paint = lazy.init(); in onDrawImage()
1983 LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, &bounds) in onDrawImage()
1986 iter.fDevice->drawImage(iter, image, x, y, looper.paint()); in onDrawImage()
1993 const SkPaint* paint) { in onDrawImageRect() argument
1997 if (NULL == paint || paint->canComputeFastBounds()) { in onDrawImageRect()
1998 if (paint) { in onDrawImageRect()
1999 bounds = &paint->computeFastBounds(dst, &storage); in onDrawImageRect()
2006 if (NULL == paint) { in onDrawImageRect()
2007 paint = lazy.init(); in onDrawImageRect()
2010 LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, bounds) in onDrawImageRect()
2013 iter.fDevice->drawImageRect(iter, image, src, dst, looper.paint()); in onDrawImageRect()
2019 void SkCanvas::onDrawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, const SkPaint* paint) { in onDrawBitmap() argument
2023 if (NULL == paint || paint->canComputeFastBounds()) { in onDrawBitmap()
2029 if (paint) { in onDrawBitmap()
2030 (void)paint->computeFastBounds(bounds, &bounds); in onDrawBitmap()
2039 this->internalDrawBitmap(bitmap, matrix, paint); in onDrawBitmap()
2044 const SkRect& dst, const SkPaint* paint, in internalDrawBitmapRect() argument
2052 if (NULL == paint || paint->canComputeFastBounds()) { in internalDrawBitmapRect()
2053 if (paint) { in internalDrawBitmapRect()
2054 bounds = &paint->computeFastBounds(dst, &storage); in internalDrawBitmapRect()
2062 if (NULL == paint) { in internalDrawBitmapRect()
2063 paint = lazy.init(); in internalDrawBitmapRect()
2066 LOOPER_BEGIN(*paint, SkDrawFilter::kBitmap_Type, bounds) in internalDrawBitmapRect()
2069 iter.fDevice->drawBitmapRect(iter, bitmap, src, dst, looper.paint(), flags); in internalDrawBitmapRect()
2076 const SkPaint* paint, DrawBitmapRectFlags flags) { in onDrawBitmapRect() argument
2079 this->internalDrawBitmapRect(bitmap, src, dst, paint, flags); in onDrawBitmapRect()
2084 const SkPaint* paint) { in internalDrawBitmapNine() argument
2088 if (NULL == paint || paint->canComputeFastBounds()) { in internalDrawBitmapNine()
2091 if (paint) { in internalDrawBitmapNine()
2092 bounds = &paint->computeFastBounds(dst, &storage); in internalDrawBitmapNine()
2146 this->internalDrawBitmapRect(bitmap, &s, d, paint, in internalDrawBitmapNine()
2153 const SkPaint* paint) { in onDrawBitmapNine() argument
2158 this->internalDrawBitmapNine(bitmap, center, dst, paint); in onDrawBitmapNine()
2163 SkDeviceFilteredPaint(SkBaseDevice* device, const SkPaint& paint) { in SkDeviceFilteredPaint() argument
2164 uint32_t filteredFlags = device->filterTextFlags(paint); in SkDeviceFilteredPaint()
2165 if (filteredFlags != paint.getFlags()) { in SkDeviceFilteredPaint()
2166 SkPaint* newPaint = fLazy.set(paint); in SkDeviceFilteredPaint()
2170 fPaint = &paint; in SkDeviceFilteredPaint()
2174 const SkPaint& paint() const { return *fPaint; } in paint() function in SkDeviceFilteredPaint
2181 void SkCanvas::DrawRect(const SkDraw& draw, const SkPaint& paint, in DrawRect() argument
2183 if (paint.getStyle() == SkPaint::kFill_Style) { in DrawRect()
2184 draw.fDevice->drawRect(draw, r, paint); in DrawRect()
2186 SkPaint p(paint); in DrawRect()
2187 p.setStrokeWidth(SkScalarMul(textSize, paint.getStrokeWidth())); in DrawRect()
2192 void SkCanvas::DrawTextDecorations(const SkDraw& draw, const SkPaint& paint, in DrawTextDecorations() argument
2200 (paint.getAlpha() == 0 && paint.getXfermode() == NULL)) { in DrawTextDecorations()
2208 if (paint.getFlags() & (SkPaint::kUnderlineText_Flag | in DrawTextDecorations()
2210 width = paint.measureText(text, byteLength); in DrawTextDecorations()
2213 if (paint.getTextAlign() == SkPaint::kCenter_Align) { in DrawTextDecorations()
2215 } else if (paint.getTextAlign() == SkPaint::kRight_Align) { in DrawTextDecorations()
2225 uint32_t flags = paint.getFlags(); in DrawTextDecorations()
2229 SkScalar textSize = paint.getTextSize(); in DrawTextDecorations()
2241 DrawRect(draw, paint, r, textSize); in DrawTextDecorations()
2248 DrawRect(draw, paint, r, textSize); in DrawTextDecorations()
2254 const SkPaint& paint) { in onDrawText() argument
2255 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) in onDrawText()
2258 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint()); in onDrawText()
2259 iter.fDevice->drawText(iter, text, byteLength, x, y, dfp.paint()); in onDrawText()
2260 DrawTextDecorations(iter, dfp.paint(), in onDrawText()
2268 const SkPaint& paint) { in onDrawPosText() argument
2271 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) in onDrawPosText()
2274 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint()); in onDrawPosText()
2276 dfp.paint()); in onDrawPosText()
2283 SkScalar constY, const SkPaint& paint) { in onDrawPosTextH() argument
2287 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) in onDrawPosTextH()
2290 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint()); in onDrawPosTextH()
2292 dfp.paint()); in onDrawPosTextH()
2299 const SkMatrix* matrix, const SkPaint& paint) { in onDrawTextOnPath() argument
2300 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, NULL) in onDrawTextOnPath()
2304 matrix, looper.paint()); in onDrawTextOnPath()
2311 const SkPaint& paint) { in onDrawTextBlob() argument
2315 if (paint.canComputeFastBounds()) { in onDrawTextBlob()
2317 bounds = &paint.computeFastBounds(storage, &storage); in onDrawTextBlob()
2329 LOOPER_BEGIN(paint, SkDrawFilter::kText_Type, bounds) in onDrawTextBlob()
2332 SkDeviceFilteredPaint dfp(iter.fDevice, looper.paint()); in onDrawTextBlob()
2333 iter.fDevice->drawTextBlob(iter, blob, x, y, dfp.paint(), drawFilter); in onDrawTextBlob()
2343 const SkPaint& paint) { in drawText() argument
2345 this->onDrawText(text, byteLength, x, y, paint); in drawText()
2348 const SkPaint& paint) { in drawPosText() argument
2350 this->onDrawPosText(text, byteLength, pos, paint); in drawPosText()
2353 SkScalar constY, const SkPaint& paint) { in drawPosTextH() argument
2355 this->onDrawPosTextH(text, byteLength, xpos, constY, paint); in drawPosTextH()
2358 const SkMatrix* matrix, const SkPaint& paint) { in drawTextOnPath() argument
2360 this->onDrawTextOnPath(text, byteLength, path, matrix, paint); in drawTextOnPath()
2363 const SkPaint& paint) { in drawTextBlob() argument
2366 this->onDrawTextBlob(blob, x, y, paint); in drawTextBlob()
2374 const SkPaint& paint) { in onDrawVertices() argument
2376 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) in onDrawVertices()
2381 looper.paint()); in onDrawVertices()
2388 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) { in drawPatch() argument
2402 this->onDrawPatch(cubics, colors, texCoords, xmode, paint); in drawPatch()
2406 const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) { in onDrawPatch() argument
2408 LOOPER_BEGIN(paint, SkDrawFilter::kPath_Type, NULL) in onDrawPatch()
2411 iter.fDevice->drawPatch(iter, cubics, colors, texCoords, xmode, paint); in onDrawPatch()
2435 SkPaint paint; in drawARGB() local
2437 paint.setARGB(a, r, g, b); in drawARGB()
2439 paint.setXfermodeMode(mode); in drawARGB()
2441 this->drawPaint(paint); in drawARGB()
2446 SkPaint paint; in drawColor() local
2448 paint.setColor(c); in drawColor()
2450 paint.setXfermodeMode(mode); in drawColor()
2452 this->drawPaint(paint); in drawColor()
2455 void SkCanvas::drawPoint(SkScalar x, SkScalar y, const SkPaint& paint) { in drawPoint() argument
2460 this->drawPoints(kPoints_PointMode, 1, &pt, paint); in drawPoint()
2466 SkPaint paint; in drawPoint() local
2469 paint.setColor(color); in drawPoint()
2470 this->drawPoints(kPoints_PointMode, 1, &pt, paint); in drawPoint()
2474 const SkPaint& paint) { in drawLine() argument
2480 this->drawPoints(kLines_PointMode, 2, pts, paint); in drawLine()
2485 const SkPaint& paint) { in drawRectCoords() argument
2490 this->drawRect(r, paint); in drawRectCoords()
2494 const SkPaint& paint) { in drawCircle() argument
2502 this->drawOval(r, paint); in drawCircle()
2506 const SkPaint& paint) { in drawRoundRect() argument
2509 if (paint.canComputeFastBounds()) { in drawRoundRect()
2511 if (this->quickReject(paint.computeFastBounds(r, &storage))) { in drawRoundRect()
2517 this->drawRRect(rrect, paint); in drawRoundRect()
2519 this->drawRect(r, paint); in drawRoundRect()
2525 const SkPaint& paint) { in drawArc() argument
2528 this->drawOval(oval, paint); in drawArc()
2538 this->drawPath(path, paint); in drawArc()
2544 SkScalar vOffset, const SkPaint& paint) { in drawTextOnPathHV() argument
2549 this->drawTextOnPath(text, byteLength, path, &matrix, paint); in drawTextOnPathHV()
2563 void SkCanvas::drawPicture(const SkPicture* picture, const SkMatrix* matrix, const SkPaint* paint) { in drawPicture() argument
2570 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); in drawPicture()
2573 this->onDrawPicture(picture, matrix, paint); in drawPicture()
2579 const SkPaint* paint) { in onDrawPicture() argument
2584 if (device->EXPERIMENTAL_drawPicture(this, picture, matrix, paint)) { in onDrawPicture()
2589 SkAutoCanvasMatrixPaint acmp(this, matrix, paint, picture->cullRect()); in onDrawPicture()
2621 const SkPaint& SkCanvas::LayerIter::paint() const { in paint() function in SkCanvas::LayerIter
2622 const SkPaint* paint = fImpl->getPaint(); in paint() local
2623 if (NULL == paint) { in paint()
2624 paint = &fDefaultPaint; in paint()
2626 return *paint; in paint()
2675 const SkPaint* paint, const SkRect& bounds) in SkAutoCanvasMatrixPaint() argument
2679 if (paint) { in SkAutoCanvasMatrixPaint()
2684 canvas->saveLayer(&newBounds, paint); in SkAutoCanvasMatrixPaint()