OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 // Make rawBounds include all paint outsets except for those due
to image filters. | 488 // Make rawBounds include all paint outsets except for those due
to image filters. |
489 rawBounds = &apply_paint_to_bounds_sans_imagefilter(*fPaint, *ra
wBounds, &storage); | 489 rawBounds = &apply_paint_to_bounds_sans_imagefilter(*fPaint, *ra
wBounds, &storage); |
490 } | 490 } |
491 (void)canvas->internalSaveLayer(SkCanvas::SaveLayerRec(rawBounds, &t
mp), | 491 (void)canvas->internalSaveLayer(SkCanvas::SaveLayerRec(rawBounds, &t
mp), |
492 SkCanvas::kFullLayer_SaveLayerStrate
gy); | 492 SkCanvas::kFullLayer_SaveLayerStrate
gy); |
493 fTempLayerForImageFilter = true; | 493 fTempLayerForImageFilter = true; |
494 // we remove the imagefilter/xfermode inside doNext() | 494 // we remove the imagefilter/xfermode inside doNext() |
495 } | 495 } |
496 | 496 |
497 if (SkDrawLooper* looper = paint.getLooper()) { | 497 if (SkDrawLooper* looper = paint.getLooper()) { |
498 fLooperContext = fLooperContextAllocator.createWithIniterT<SkDrawLoo
per::Context>( | 498 void* buffer = fLooperContextAllocator.reserveT<SkDrawLooper::Contex
t>( |
499 looper->contextSize(), | 499 looper->contextSize()); |
500 [&](void* buffer) { | 500 fLooperContext = looper->createContext(canvas, buffer); |
501 return looper->createContext(canvas, buffer); | |
502 }); | |
503 fIsSimple = false; | 501 fIsSimple = false; |
504 } else { | 502 } else { |
505 fLooperContext = nullptr; | 503 fLooperContext = nullptr; |
506 // can we be marked as simple? | 504 // can we be marked as simple? |
507 fIsSimple = !fFilter && !fTempLayerForImageFilter; | 505 fIsSimple = !fFilter && !fTempLayerForImageFilter; |
508 } | 506 } |
509 } | 507 } |
510 | 508 |
511 ~AutoDrawLooper() { | 509 ~AutoDrawLooper() { |
512 if (fTempLayerForImageFilter) { | 510 if (fTempLayerForImageFilter) { |
(...skipping 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3371 const SkCanvas::ClipOp SkCanvas::kXOR_Op; | 3369 const SkCanvas::ClipOp SkCanvas::kXOR_Op; |
3372 const SkCanvas::ClipOp SkCanvas::kReverseDifference_Op; | 3370 const SkCanvas::ClipOp SkCanvas::kReverseDifference_Op; |
3373 const SkCanvas::ClipOp SkCanvas::kReplace_Op; | 3371 const SkCanvas::ClipOp SkCanvas::kReplace_Op; |
3374 | 3372 |
3375 static_assert((int)SkRegion::kDifference_Op == (int)kDifference_SkClipOp
, ""); | 3373 static_assert((int)SkRegion::kDifference_Op == (int)kDifference_SkClipOp
, ""); |
3376 static_assert((int)SkRegion::kIntersect_Op == (int)kIntersect_SkClipOp,
""); | 3374 static_assert((int)SkRegion::kIntersect_Op == (int)kIntersect_SkClipOp,
""); |
3377 static_assert((int)SkRegion::kUnion_Op == (int)kUnion_SkClipOp, "")
; | 3375 static_assert((int)SkRegion::kUnion_Op == (int)kUnion_SkClipOp, "")
; |
3378 static_assert((int)SkRegion::kXOR_Op == (int)kXOR_SkClipOp, ""); | 3376 static_assert((int)SkRegion::kXOR_Op == (int)kXOR_SkClipOp, ""); |
3379 static_assert((int)SkRegion::kReverseDifference_Op == (int)kReverseDifference_S
kClipOp, ""); | 3377 static_assert((int)SkRegion::kReverseDifference_Op == (int)kReverseDifference_S
kClipOp, ""); |
3380 static_assert((int)SkRegion::kReplace_Op == (int)kReplace_SkClipOp, "
"); | 3378 static_assert((int)SkRegion::kReplace_Op == (int)kReplace_SkClipOp, "
"); |
OLD | NEW |