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 "SkRecordDraw.h" | 8 #include "SkRecordDraw.h" |
9 #include "SkPatchUtils.h" | 9 #include "SkPatchUtils.h" |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 legacy_drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r
.constraint)); | 100 legacy_drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r
.constraint)); |
101 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); | 101 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); |
102 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); | 102 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); |
103 DRAW(DrawImageRect, legacy_drawImageRect(r.image, r.src, r.dst, r.paint, r.const
raint)); | 103 DRAW(DrawImageRect, legacy_drawImageRect(r.image, r.src, r.dst, r.paint, r.const
raint)); |
104 DRAW(DrawImageNine, drawImageNine(r.image, r.center, r.dst, r.paint)); | 104 DRAW(DrawImageNine, drawImageNine(r.image, r.center, r.dst, r.paint)); |
105 DRAW(DrawOval, drawOval(r.oval, r.paint)); | 105 DRAW(DrawOval, drawOval(r.oval, r.paint)); |
106 DRAW(DrawPaint, drawPaint(r.paint)); | 106 DRAW(DrawPaint, drawPaint(r.paint)); |
107 DRAW(DrawPath, drawPath(r.path, r.paint)); | 107 DRAW(DrawPath, drawPath(r.path, r.paint)); |
108 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); | 108 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); |
109 DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint)); | 109 DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint)); |
| 110 DRAW(DrawShadowedPicture, drawShadowedPicture(r.picture, r.lights)); |
110 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); | 111 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); |
111 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); | 112 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); |
112 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); | 113 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); |
113 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); | 114 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); |
114 DRAW(DrawRect, drawRect(r.rect, r.paint)); | 115 DRAW(DrawRect, drawRect(r.rect, r.paint)); |
115 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); | 116 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); |
116 DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint)); | 117 DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint)); |
117 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.p
aint)); | 118 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.p
aint)); |
118 DRAW(DrawTextRSXform, drawTextRSXform(r.text, r.byteLength, r.xforms, r.cull, r.
paint)); | 119 DRAW(DrawTextRSXform, drawTextRSXform(r.text, r.byteLength, r.xforms, r.cull, r.
paint)); |
119 DRAW(DrawAtlas, drawAtlas(r.atlas, r.xforms, r.texs, r.colors, r.count, r.mode,
r.cull, r.paint)); | 120 DRAW(DrawAtlas, drawAtlas(r.atlas, r.xforms, r.texs, r.colors, r.count, r.mode,
r.cull, r.paint)); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 return fCurrentClipBounds; | 466 return fCurrentClipBounds; |
466 } | 467 } |
467 } | 468 } |
468 | 469 |
469 Bounds bounds(const DrawPicture& op) const { | 470 Bounds bounds(const DrawPicture& op) const { |
470 SkRect dst = op.picture->cullRect(); | 471 SkRect dst = op.picture->cullRect(); |
471 op.matrix.mapRect(&dst); | 472 op.matrix.mapRect(&dst); |
472 return this->adjustAndMap(dst, op.paint); | 473 return this->adjustAndMap(dst, op.paint); |
473 } | 474 } |
474 | 475 |
| 476 Bounds bounds(const DrawShadowedPicture& op) const { |
| 477 SkRect dst = op.picture->cullRect(); |
| 478 return this->adjustAndMap(dst, nullptr); |
| 479 } |
| 480 |
475 Bounds bounds(const DrawPosText& op) const { | 481 Bounds bounds(const DrawPosText& op) const { |
476 const int N = op.paint.countText(op.text, op.byteLength); | 482 const int N = op.paint.countText(op.text, op.byteLength); |
477 if (N == 0) { | 483 if (N == 0) { |
478 return Bounds::MakeEmpty(); | 484 return Bounds::MakeEmpty(); |
479 } | 485 } |
480 | 486 |
481 SkRect dst; | 487 SkRect dst; |
482 dst.set(op.pos, N); | 488 dst.set(op.pos, N); |
483 AdjustTextForFontMetrics(&dst, op.paint); | 489 AdjustTextForFontMetrics(&dst, op.paint); |
484 return this->adjustAndMap(dst, &op.paint); | 490 return this->adjustAndMap(dst, &op.paint); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 | 618 |
613 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkRect b
ounds[]) { | 619 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkRect b
ounds[]) { |
614 SkRecords::FillBounds visitor(cullRect, record, bounds); | 620 SkRecords::FillBounds visitor(cullRect, record, bounds); |
615 for (int curOp = 0; curOp < record.count(); curOp++) { | 621 for (int curOp = 0; curOp < record.count(); curOp++) { |
616 visitor.setCurrentOp(curOp); | 622 visitor.setCurrentOp(curOp); |
617 record.visit(curOp, visitor); | 623 record.visit(curOp, visitor); |
618 } | 624 } |
619 visitor.cleanUp(); | 625 visitor.cleanUp(); |
620 } | 626 } |
621 | 627 |
OLD | NEW |