| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); | 108 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); |
| 109 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); | 109 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); |
| 110 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); | 110 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); |
| 111 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); | 111 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); |
| 112 DRAW(DrawRect, drawRect(r.rect, r.paint)); | 112 DRAW(DrawRect, drawRect(r.rect, r.paint)); |
| 113 DRAW(DrawSprite, drawSprite(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); | 113 DRAW(DrawSprite, drawSprite(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); |
| 114 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); | 114 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); |
| 115 DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint)); | 115 DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint)); |
| 116 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.p
aint)); | 116 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.p
aint)); |
| 117 DRAW(DrawAtlas, drawAtlas(r.atlas, r.xforms, r.texs, r.colors, r.count, r.mode,
r.cull, r.paint)); | 117 DRAW(DrawAtlas, drawAtlas(r.atlas, r.xforms, r.texs, r.colors, r.count, r.mode,
r.cull, r.paint)); |
| 118 DRAW(DrawLitAtlas, drawLitAtlas(r.atlas, r.xforms, r.diffTexs, r.normTexs, r.col
ors, |
| 119 r.count, r.mode, r.cull, r.paint, r.lights, r.nu
mLights)); |
| 118 DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.co
lors, | 120 DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.co
lors, |
| 119 r.xmode.get(), r.indices, r.indexCount, r.paint)
); | 121 r.xmode.get(), r.indices, r.indexCount, r.paint)
); |
| 120 #undef DRAW | 122 #undef DRAW |
| 121 | 123 |
| 122 template <> void Draw::draw(const DrawDrawable& r) { | 124 template <> void Draw::draw(const DrawDrawable& r) { |
| 123 SkASSERT(r.index >= 0); | 125 SkASSERT(r.index >= 0); |
| 124 SkASSERT(r.index < fDrawableCount); | 126 SkASSERT(r.index < fDrawableCount); |
| 125 if (fDrawables) { | 127 if (fDrawables) { |
| 126 SkASSERT(NULL == fDrawablePicts); | 128 SkASSERT(NULL == fDrawablePicts); |
| 127 fCanvas->drawDrawable(fDrawables[r.index], r.matrix); | 129 fCanvas->drawDrawable(fDrawables[r.index], r.matrix); |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 } | 465 } |
| 464 | 466 |
| 465 Bounds bounds(const DrawAtlas& op) const { | 467 Bounds bounds(const DrawAtlas& op) const { |
| 466 if (op.cull) { | 468 if (op.cull) { |
| 467 return this->adjustAndMap(*op.cull, op.paint); | 469 return this->adjustAndMap(*op.cull, op.paint); |
| 468 } else { | 470 } else { |
| 469 return fCurrentClipBounds; | 471 return fCurrentClipBounds; |
| 470 } | 472 } |
| 471 } | 473 } |
| 472 | 474 |
| 475 Bounds bounds(const DrawLitAtlas& op) const { |
| 476 if (op.cull) { |
| 477 return this->adjustAndMap(*op.cull, op.paint); |
| 478 } else { |
| 479 return fCurrentClipBounds; |
| 480 } |
| 481 } |
| 482 |
| 473 Bounds bounds(const DrawPicture& op) const { | 483 Bounds bounds(const DrawPicture& op) const { |
| 474 SkRect dst = op.picture->cullRect(); | 484 SkRect dst = op.picture->cullRect(); |
| 475 op.matrix.mapRect(&dst); | 485 op.matrix.mapRect(&dst); |
| 476 return this->adjustAndMap(dst, op.paint); | 486 return this->adjustAndMap(dst, op.paint); |
| 477 } | 487 } |
| 478 | 488 |
| 479 Bounds bounds(const DrawPosText& op) const { | 489 Bounds bounds(const DrawPosText& op) const { |
| 480 const int N = op.paint.countText(op.text, op.byteLength); | 490 const int N = op.paint.countText(op.text, op.byteLength); |
| 481 if (N == 0) { | 491 if (N == 0) { |
| 482 return Bounds::MakeEmpty(); | 492 return Bounds::MakeEmpty(); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); | 819 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); |
| 810 | 820 |
| 811 for (unsigned curOp = 0; curOp < record.count(); curOp++) { | 821 for (unsigned curOp = 0; curOp < record.count(); curOp++) { |
| 812 visitor.setCurrentOp(curOp); | 822 visitor.setCurrentOp(curOp); |
| 813 record.visit<void>(curOp, visitor); | 823 record.visit<void>(curOp, visitor); |
| 814 } | 824 } |
| 815 | 825 |
| 816 visitor.cleanUp(bbh); | 826 visitor.cleanUp(bbh); |
| 817 } | 827 } |
| 818 | 828 |
| OLD | NEW |