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 "SkLayerInfo.h" | 8 #include "SkLayerInfo.h" |
9 #include "SkRecordDraw.h" | 9 #include "SkRecordDraw.h" |
10 #include "SkPatchUtils.h" | 10 #include "SkPatchUtils.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa)); | 94 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa)); |
95 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); | 95 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); |
96 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); | 96 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); |
97 DRAW(ClipRegion, clipRegion(r.region, r.op)); | 97 DRAW(ClipRegion, clipRegion(r.region, r.op)); |
98 | 98 |
99 DRAW(BeginCommentGroup, beginCommentGroup(r.description)); | 99 DRAW(BeginCommentGroup, beginCommentGroup(r.description)); |
100 DRAW(AddComment, addComment(r.key, r.value)); | 100 DRAW(AddComment, addComment(r.key, r.value)); |
101 DRAW(EndCommentGroup, endCommentGroup()); | 101 DRAW(EndCommentGroup, endCommentGroup()); |
102 | 102 |
103 DRAW(DrawBitmap, drawBitmap(shallow_copy(r.bitmap), r.left, r.top, r.paint)); | 103 DRAW(DrawBitmap, drawBitmap(shallow_copy(r.bitmap), r.left, r.top, r.paint)); |
104 DRAW(DrawBitmapMatrix, drawBitmapMatrix(shallow_copy(r.bitmap), r.matrix, r.pain
t)); | |
105 DRAW(DrawBitmapNine, drawBitmapNine(shallow_copy(r.bitmap), r.center, r.dst, r.p
aint)); | 104 DRAW(DrawBitmapNine, drawBitmapNine(shallow_copy(r.bitmap), r.center, r.dst, r.p
aint)); |
106 DRAW(DrawBitmapRectToRect, | 105 DRAW(DrawBitmapRectToRect, |
107 drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, | 106 drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, |
108 SkCanvas::kNone_DrawBitmapRectFlag)); | 107 SkCanvas::kNone_DrawBitmapRectFlag)); |
109 DRAW(DrawBitmapRectToRectBleed, | 108 DRAW(DrawBitmapRectToRectBleed, |
110 drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, | 109 drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, |
111 SkCanvas::kBleed_DrawBitmapRectFlag)); | 110 SkCanvas::kBleed_DrawBitmapRectFlag)); |
112 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); | 111 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); |
113 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); | 112 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); |
114 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint)); | 113 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint)); |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 return this->adjustAndMap(op.dst, op.paint); | 428 return this->adjustAndMap(op.dst, op.paint); |
430 } | 429 } |
431 Bounds bounds(const DrawBitmapNine& op) const { | 430 Bounds bounds(const DrawBitmapNine& op) const { |
432 return this->adjustAndMap(op.dst, op.paint); | 431 return this->adjustAndMap(op.dst, op.paint); |
433 } | 432 } |
434 Bounds bounds(const DrawBitmap& op) const { | 433 Bounds bounds(const DrawBitmap& op) const { |
435 return this->adjustAndMap( | 434 return this->adjustAndMap( |
436 SkRect::MakeXYWH(op.left, op.top, op.bitmap.width(), op.bitmap.h
eight()), | 435 SkRect::MakeXYWH(op.left, op.top, op.bitmap.width(), op.bitmap.h
eight()), |
437 op.paint); | 436 op.paint); |
438 } | 437 } |
439 Bounds bounds(const DrawBitmapMatrix& op) const { | |
440 SkRect dst = SkRect::MakeWH(op.bitmap.width(), op.bitmap.height()); | |
441 op.matrix.mapRect(&dst); | |
442 return this->adjustAndMap(dst, op.paint); | |
443 } | |
444 | 438 |
445 Bounds bounds(const DrawPath& op) const { | 439 Bounds bounds(const DrawPath& op) const { |
446 return op.path.isInverseFillType() ? fCurrentClipBounds | 440 return op.path.isInverseFillType() ? fCurrentClipBounds |
447 : this->adjustAndMap(op.path.getBound
s(), &op.paint); | 441 : this->adjustAndMap(op.path.getBound
s(), &op.paint); |
448 } | 442 } |
449 Bounds bounds(const DrawPoints& op) const { | 443 Bounds bounds(const DrawPoints& op) const { |
450 SkRect dst; | 444 SkRect dst; |
451 dst.set(op.pts, op.count); | 445 dst.set(op.pts, op.count); |
452 | 446 |
453 // Pad the bounding box a little to make sure hairline points' bounds ar
en't empty. | 447 // Pad the bounding box a little to make sure hairline points' bounds ar
en't empty. |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); | 795 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); |
802 | 796 |
803 for (unsigned curOp = 0; curOp < record.count(); curOp++) { | 797 for (unsigned curOp = 0; curOp < record.count(); curOp++) { |
804 visitor.setCurrentOp(curOp); | 798 visitor.setCurrentOp(curOp); |
805 record.visit<void>(curOp, visitor); | 799 record.visit<void>(curOp, visitor); |
806 } | 800 } |
807 | 801 |
808 visitor.cleanUp(bbh); | 802 visitor.cleanUp(bbh); |
809 } | 803 } |
810 | 804 |
OLD | NEW |