Lines Matching refs:paint

234 static FlatFlags unpack_paint_flags(SkPaint* paint, uint32_t packed, SkFont* font) {  in unpack_paint_flags()  argument
236 paint->setAntiAlias((f & kAA_PaintFlagForPaint) != 0); in unpack_paint_flags()
237 paint->setDither((f & kDither_PaintFlagForPaint) != 0); in unpack_paint_flags()
258 paint->setFilterQuality((SkFilterQuality)((packed >> 10) & BPF_Mask(kFilter_BPF))); in unpack_paint_flags()
279 static uint32_t pack_v68(const SkPaint& paint, unsigned flatFlags) { in pack_v68() argument
281 packed |= shift_bits(((unsigned)paint.isDither() << 1) | in pack_v68()
282 (unsigned)paint.isAntiAlias(), 0, 8); in pack_v68()
283 packed |= shift_bits(paint.getBlendMode(), 8, 8); in pack_v68()
284 packed |= shift_bits(paint.getStrokeCap(), 16, 2); in pack_v68()
285 packed |= shift_bits(paint.getStrokeJoin(), 18, 2); in pack_v68()
286 packed |= shift_bits(paint.getStyle(), 20, 2); in pack_v68()
287 packed |= shift_bits(paint.getFilterQuality(), 22, 2); in pack_v68()
292 static uint32_t unpack_v68(SkPaint* paint, uint32_t packed, SkSafeRange& safe) { in unpack_v68() argument
293 paint->setAntiAlias((packed & 1) != 0); in unpack_v68()
294 paint->setDither((packed & 2) != 0); in unpack_v68()
296 paint->setBlendMode(safe.checkLE(packed & 0xFF, SkBlendMode::kLastMode)); in unpack_v68()
298 paint->setStrokeCap(safe.checkLE(packed & 0x3, SkPaint::kLast_Cap)); in unpack_v68()
300 paint->setStrokeJoin(safe.checkLE(packed & 0x3, SkPaint::kLast_Join)); in unpack_v68()
302 paint->setStyle(safe.checkLE(packed & 0x3, SkPaint::kStrokeAndFill_Style)); in unpack_v68()
304 paint->setFilterQuality(safe.checkLE(packed & 0x3, kLast_SkFilterQuality)); in unpack_v68()
312 void SkPaintPriv::Flatten(const SkPaint& paint, SkWriteBuffer& buffer) { in Flatten() argument
315 if (paint.getPathEffect() || in Flatten()
316 paint.getShader() || in Flatten()
317 paint.getMaskFilter() || in Flatten()
318 paint.getColorFilter() || in Flatten()
319 paint.getLooper() || in Flatten()
320 paint.getImageFilter()) { in Flatten()
324 buffer.writeScalar(paint.getStrokeWidth()); in Flatten()
325 buffer.writeScalar(paint.getStrokeMiter()); in Flatten()
326 buffer.writeColor4f(paint.getColor4f()); in Flatten()
328 buffer.write32(pack_v68(paint, flatFlags)); in Flatten()
331 buffer.writeFlattenable(paint.getPathEffect()); in Flatten()
332 buffer.writeFlattenable(paint.getShader()); in Flatten()
333 buffer.writeFlattenable(paint.getMaskFilter()); in Flatten()
334 buffer.writeFlattenable(paint.getColorFilter()); in Flatten()
335 buffer.writeFlattenable(paint.getLooper()); in Flatten()
336 buffer.writeFlattenable(paint.getImageFilter()); in Flatten()
340 SkReadPaintResult SkPaintPriv::Unflatten_PreV68(SkPaint* paint, SkReadBuffer& buffer, SkFont* font)… in Unflatten_PreV68() argument
354 paint->setStrokeWidth(buffer.readScalar()); in Unflatten_PreV68()
355 paint->setStrokeMiter(buffer.readScalar()); in Unflatten_PreV68()
357 paint->setColor(buffer.readColor()); in Unflatten_PreV68()
361 paint->setColor4f(color, sk_srgb_singleton()); in Unflatten_PreV68()
364 unsigned flatFlags = unpack_paint_flags(paint, buffer.readUInt(), font); in Unflatten_PreV68()
367 paint->setStrokeCap(safe.checkLE((tmp >> 24) & 0xFF, SkPaint::kLast_Cap)); in Unflatten_PreV68()
368 paint->setStrokeJoin(safe.checkLE((tmp >> 16) & 0xFF, SkPaint::kLast_Join)); in Unflatten_PreV68()
369 paint->setStyle(safe.checkLE((tmp >> 12) & 0xF, SkPaint::kStrokeAndFill_Style)); in Unflatten_PreV68()
370 paint->setBlendMode(safe.checkLE(tmp & 0xFF, SkBlendMode::kLastMode)); in Unflatten_PreV68()
381 paint->setPathEffect(buffer.readPathEffect()); in Unflatten_PreV68()
382 paint->setShader(buffer.readShader()); in Unflatten_PreV68()
383 paint->setMaskFilter(buffer.readMaskFilter()); in Unflatten_PreV68()
384 paint->setColorFilter(buffer.readColorFilter()); in Unflatten_PreV68()
386 paint->setLooper(buffer.readDrawLooper()); in Unflatten_PreV68()
387 paint->setImageFilter(buffer.readImageFilter()); in Unflatten_PreV68()
389 paint->setPathEffect(nullptr); in Unflatten_PreV68()
390 paint->setShader(nullptr); in Unflatten_PreV68()
391 paint->setMaskFilter(nullptr); in Unflatten_PreV68()
392 paint->setColorFilter(nullptr); in Unflatten_PreV68()
393 paint->setLooper(nullptr); in Unflatten_PreV68()
394 paint->setImageFilter(nullptr); in Unflatten_PreV68()
398 paint->reset(); in Unflatten_PreV68()
404 SkReadPaintResult SkPaintPriv::Unflatten(SkPaint* paint, SkReadBuffer& buffer, SkFont* font) { in Unflatten() argument
406 return Unflatten_PreV68(paint, buffer, font); in Unflatten()
411 paint->setStrokeWidth(buffer.readScalar()); in Unflatten()
412 paint->setStrokeMiter(buffer.readScalar()); in Unflatten()
416 paint->setColor4f(color, sk_srgb_singleton()); in Unflatten()
419 unsigned flatFlags = unpack_v68(paint, buffer.readUInt(), safe); in Unflatten()
422 paint->setPathEffect(buffer.readPathEffect()); in Unflatten()
423 paint->setShader(buffer.readShader()); in Unflatten()
424 paint->setMaskFilter(buffer.readMaskFilter()); in Unflatten()
425 paint->setColorFilter(buffer.readColorFilter()); in Unflatten()
426 paint->setLooper(buffer.readDrawLooper()); in Unflatten()
427 paint->setImageFilter(buffer.readImageFilter()); in Unflatten()
429 paint->setPathEffect(nullptr); in Unflatten()
430 paint->setShader(nullptr); in Unflatten()
431 paint->setMaskFilter(nullptr); in Unflatten()
432 paint->setColorFilter(nullptr); in Unflatten()
433 paint->setLooper(nullptr); in Unflatten()
434 paint->setImageFilter(nullptr); in Unflatten()
438 paint->reset(); in Unflatten()