OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
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 "SkCanvasPriv.h" |
8 #include "SkLayerInfo.h" | 9 #include "SkLayerInfo.h" |
9 #include "SkRecordDraw.h" | 10 #include "SkRecordDraw.h" |
10 #include "SkPatchUtils.h" | 11 #include "SkPatchUtils.h" |
11 | 12 |
12 void SkRecordDraw(const SkRecord& record, | 13 void SkRecordDraw(const SkRecord& record, |
13 SkCanvas* canvas, | 14 SkCanvas* canvas, |
14 SkPicture const* const drawablePicts[], | 15 SkPicture const* const drawablePicts[], |
15 SkDrawable* const drawables[], | 16 SkDrawable* const drawables[], |
16 int drawableCount, | 17 int drawableCount, |
17 const SkBBoxHierarchy* bbh, | 18 const SkBBoxHierarchy* bbh, |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix))); | 83 DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix))); |
83 DRAW(Concat, concat(r.matrix)); | 84 DRAW(Concat, concat(r.matrix)); |
84 | 85 |
85 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa)); | 86 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa)); |
86 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); | 87 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); |
87 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); | 88 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); |
88 DRAW(ClipRegion, clipRegion(r.region, r.op)); | 89 DRAW(ClipRegion, clipRegion(r.region, r.op)); |
89 | 90 |
90 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); | 91 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); |
91 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p
aint)); | 92 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p
aint)); |
| 93 DRAW(DrawBitmapNineDivs, |
| 94 drawBitmapNine(r.bitmap.shallowCopy(), SkNinePatchDivs::FromData(r.divs.
get()), r.dst, |
| 95 r.paint)); |
92 DRAW(DrawBitmapRect, | 96 DRAW(DrawBitmapRect, |
93 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, | 97 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, |
94 SkCanvas::kStrict_SrcRectConstraint)); | 98 SkCanvas::kStrict_SrcRectConstraint)); |
95 DRAW(DrawBitmapRectFast, | 99 DRAW(DrawBitmapRectFast, |
96 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, | 100 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, |
97 SkCanvas::kFast_SrcRectConstraint)); | 101 SkCanvas::kFast_SrcRectConstraint)); |
98 DRAW(DrawBitmapRectFixedSize, | 102 DRAW(DrawBitmapRectFixedSize, |
99 legacy_drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r
.constraint)); | 103 legacy_drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r
.constraint)); |
100 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); | 104 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); |
101 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); | 105 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 419 } |
416 Bounds bounds(const DrawBitmapRectFast& op) const { | 420 Bounds bounds(const DrawBitmapRectFast& op) const { |
417 return this->adjustAndMap(op.dst, op.paint); | 421 return this->adjustAndMap(op.dst, op.paint); |
418 } | 422 } |
419 Bounds bounds(const DrawBitmapRectFixedSize& op) const { | 423 Bounds bounds(const DrawBitmapRectFixedSize& op) const { |
420 return this->adjustAndMap(op.dst, &op.paint); | 424 return this->adjustAndMap(op.dst, &op.paint); |
421 } | 425 } |
422 Bounds bounds(const DrawBitmapNine& op) const { | 426 Bounds bounds(const DrawBitmapNine& op) const { |
423 return this->adjustAndMap(op.dst, op.paint); | 427 return this->adjustAndMap(op.dst, op.paint); |
424 } | 428 } |
| 429 Bounds bounds(const DrawBitmapNineDivs& op) const { |
| 430 return this->adjustAndMap(op.dst, op.paint); |
| 431 } |
425 Bounds bounds(const DrawBitmap& op) const { | 432 Bounds bounds(const DrawBitmap& op) const { |
426 return this->adjustAndMap( | 433 return this->adjustAndMap( |
427 SkRect::MakeXYWH(op.left, op.top, op.bitmap.width(), op.bitmap.h
eight()), | 434 SkRect::MakeXYWH(op.left, op.top, op.bitmap.width(), op.bitmap.h
eight()), |
428 op.paint); | 435 op.paint); |
429 } | 436 } |
430 | 437 |
431 Bounds bounds(const DrawPath& op) const { | 438 Bounds bounds(const DrawPath& op) const { |
432 return op.path.isInverseFillType() ? fCurrentClipBounds | 439 return op.path.isInverseFillType() ? fCurrentClipBounds |
433 : this->adjustAndMap(op.path.getBound
s(), &op.paint); | 440 : this->adjustAndMap(op.path.getBound
s(), &op.paint); |
434 } | 441 } |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
815 | 822 |
816 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec
t bounds[], | 823 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec
t bounds[], |
817 const SkBigPicture::SnapshotArray* pictList, SkLayerI
nfo* data) { | 824 const SkBigPicture::SnapshotArray* pictList, SkLayerI
nfo* data) { |
818 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data); | 825 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data); |
819 for (int curOp = 0; curOp < record.count(); curOp++) { | 826 for (int curOp = 0; curOp < record.count(); curOp++) { |
820 visitor.setCurrentOp(curOp); | 827 visitor.setCurrentOp(curOp); |
821 record.visit(curOp, visitor); | 828 record.visit(curOp, visitor); |
822 } | 829 } |
823 visitor.cleanUp(); | 830 visitor.cleanUp(); |
824 } | 831 } |
OLD | NEW |