| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 DRAW(ClipRegion, clipRegion(r.region, r.op)); | 87 DRAW(ClipRegion, clipRegion(r.region, r.op)); |
| 88 | 88 |
| 89 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); | 89 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); |
| 90 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p
aint)); | 90 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p
aint)); |
| 91 DRAW(DrawBitmapRectToRect, | 91 DRAW(DrawBitmapRectToRect, |
| 92 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, | 92 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, |
| 93 SkCanvas::kNone_DrawBitmapRectFlag)); | 93 SkCanvas::kNone_DrawBitmapRectFlag)); |
| 94 DRAW(DrawBitmapRectToRectBleed, | 94 DRAW(DrawBitmapRectToRectBleed, |
| 95 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, | 95 drawBitmapRectToRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, |
| 96 SkCanvas::kBleed_DrawBitmapRectFlag)); | 96 SkCanvas::kBleed_DrawBitmapRectFlag)); |
| 97 DRAW(DrawBitmapRectToRectFixedSize, |
| 98 drawBitmapRectToRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r.
flags)); |
| 97 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); | 99 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); |
| 98 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); | 100 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); |
| 99 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint)); | 101 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint)); |
| 100 DRAW(DrawImageNine, drawImageNine(r.image, r.center, r.dst, r.paint)); | 102 DRAW(DrawImageNine, drawImageNine(r.image, r.center, r.dst, r.paint)); |
| 101 DRAW(DrawOval, drawOval(r.oval, r.paint)); | 103 DRAW(DrawOval, drawOval(r.oval, r.paint)); |
| 102 DRAW(DrawPaint, drawPaint(r.paint)); | 104 DRAW(DrawPaint, drawPaint(r.paint)); |
| 103 DRAW(DrawPath, drawPath(r.path, r.paint)); | 105 DRAW(DrawPath, drawPath(r.path, r.paint)); |
| 104 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); | 106 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); |
| 105 DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint)); | 107 DRAW(DrawPicture, drawPicture(r.picture, &r.matrix, r.paint)); |
| 106 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); | 108 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 418 } |
| 417 Bounds bounds(const DrawImageNine& op) const { | 419 Bounds bounds(const DrawImageNine& op) const { |
| 418 return this->adjustAndMap(op.dst, op.paint); | 420 return this->adjustAndMap(op.dst, op.paint); |
| 419 } | 421 } |
| 420 Bounds bounds(const DrawBitmapRectToRect& op) const { | 422 Bounds bounds(const DrawBitmapRectToRect& op) const { |
| 421 return this->adjustAndMap(op.dst, op.paint); | 423 return this->adjustAndMap(op.dst, op.paint); |
| 422 } | 424 } |
| 423 Bounds bounds(const DrawBitmapRectToRectBleed& op) const { | 425 Bounds bounds(const DrawBitmapRectToRectBleed& op) const { |
| 424 return this->adjustAndMap(op.dst, op.paint); | 426 return this->adjustAndMap(op.dst, op.paint); |
| 425 } | 427 } |
| 428 Bounds bounds(const DrawBitmapRectToRectFixedSize& op) const { |
| 429 return this->adjustAndMap(op.dst, &op.paint); |
| 430 } |
| 426 Bounds bounds(const DrawBitmapNine& op) const { | 431 Bounds bounds(const DrawBitmapNine& op) const { |
| 427 return this->adjustAndMap(op.dst, op.paint); | 432 return this->adjustAndMap(op.dst, op.paint); |
| 428 } | 433 } |
| 429 Bounds bounds(const DrawBitmap& op) const { | 434 Bounds bounds(const DrawBitmap& op) const { |
| 430 return this->adjustAndMap( | 435 return this->adjustAndMap( |
| 431 SkRect::MakeXYWH(op.left, op.top, op.bitmap.width(), op.bitmap.h
eight()), | 436 SkRect::MakeXYWH(op.left, op.top, op.bitmap.width(), op.bitmap.h
eight()), |
| 432 op.paint); | 437 op.paint); |
| 433 } | 438 } |
| 434 | 439 |
| 435 Bounds bounds(const DrawPath& op) const { | 440 Bounds bounds(const DrawPath& op) const { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 449 Bounds bounds(const DrawPatch& op) const { | 454 Bounds bounds(const DrawPatch& op) const { |
| 450 SkRect dst; | 455 SkRect dst; |
| 451 dst.set(op.cubics, SkPatchUtils::kNumCtrlPts); | 456 dst.set(op.cubics, SkPatchUtils::kNumCtrlPts); |
| 452 return this->adjustAndMap(dst, &op.paint); | 457 return this->adjustAndMap(dst, &op.paint); |
| 453 } | 458 } |
| 454 Bounds bounds(const DrawVertices& op) const { | 459 Bounds bounds(const DrawVertices& op) const { |
| 455 SkRect dst; | 460 SkRect dst; |
| 456 dst.set(op.vertices, op.vertexCount); | 461 dst.set(op.vertices, op.vertexCount); |
| 457 return this->adjustAndMap(dst, &op.paint); | 462 return this->adjustAndMap(dst, &op.paint); |
| 458 } | 463 } |
| 459 | 464 |
| 460 Bounds bounds(const DrawAtlas& op) const { | 465 Bounds bounds(const DrawAtlas& op) const { |
| 461 if (op.cull) { | 466 if (op.cull) { |
| 462 return this->adjustAndMap(*op.cull, op.paint); | 467 return this->adjustAndMap(*op.cull, op.paint); |
| 463 } else { | 468 } else { |
| 464 return fCurrentClipBounds; | 469 return fCurrentClipBounds; |
| 465 } | 470 } |
| 466 } | 471 } |
| 467 | 472 |
| 468 Bounds bounds(const DrawPicture& op) const { | 473 Bounds bounds(const DrawPicture& op) const { |
| 469 SkRect dst = op.picture->cullRect(); | 474 SkRect dst = op.picture->cullRect(); |
| 470 op.matrix.mapRect(&dst); | 475 op.matrix.mapRect(&dst); |
| 471 return this->adjustAndMap(dst, op.paint); | 476 return this->adjustAndMap(dst, op.paint); |
| 472 } | 477 } |
| 473 | 478 |
| 474 Bounds bounds(const DrawPosText& op) const { | 479 Bounds bounds(const DrawPosText& op) const { |
| 475 const int N = op.paint.countText(op.text, op.byteLength); | 480 const int N = op.paint.countText(op.text, op.byteLength); |
| 476 if (N == 0) { | 481 if (N == 0) { |
| 477 return Bounds::MakeEmpty(); | 482 return Bounds::MakeEmpty(); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); | 809 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); |
| 805 | 810 |
| 806 for (unsigned curOp = 0; curOp < record.count(); curOp++) { | 811 for (unsigned curOp = 0; curOp < record.count(); curOp++) { |
| 807 visitor.setCurrentOp(curOp); | 812 visitor.setCurrentOp(curOp); |
| 808 record.visit<void>(curOp, visitor); | 813 record.visit<void>(curOp, visitor); |
| 809 } | 814 } |
| 810 | 815 |
| 811 visitor.cleanUp(bbh); | 816 visitor.cleanUp(bbh); |
| 812 } | 817 } |
| 813 | 818 |
| OLD | NEW |