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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 DRAW(BeginCommentGroup, beginCommentGroup(r.description)); | 86 DRAW(BeginCommentGroup, beginCommentGroup(r.description)); |
87 DRAW(AddComment, addComment(r.key, r.value)); | 87 DRAW(AddComment, addComment(r.key, r.value)); |
88 DRAW(EndCommentGroup, endCommentGroup()); | 88 DRAW(EndCommentGroup, endCommentGroup()); |
89 | 89 |
90 DRAW(DrawBitmap, drawBitmap(shallow_copy(r.bitmap), r.left, r.top, r.paint)); | 90 DRAW(DrawBitmap, drawBitmap(shallow_copy(r.bitmap), r.left, r.top, r.paint)); |
91 DRAW(DrawBitmapMatrix, drawBitmapMatrix(shallow_copy(r.bitmap), r.matrix, r.pain
t)); | 91 DRAW(DrawBitmapMatrix, drawBitmapMatrix(shallow_copy(r.bitmap), r.matrix, r.pain
t)); |
92 DRAW(DrawBitmapNine, drawBitmapNine(shallow_copy(r.bitmap), r.center, r.dst, r.p
aint)); | 92 DRAW(DrawBitmapNine, drawBitmapNine(shallow_copy(r.bitmap), r.center, r.dst, r.p
aint)); |
93 DRAW(DrawBitmapRectToRect, | 93 DRAW(DrawBitmapRectToRect, |
94 drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, r.fl
ags)); | 94 drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, r.fl
ags)); |
95 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); | 95 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); |
| 96 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); |
| 97 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint)); |
96 DRAW(DrawOval, drawOval(r.oval, r.paint)); | 98 DRAW(DrawOval, drawOval(r.oval, r.paint)); |
97 DRAW(DrawPaint, drawPaint(r.paint)); | 99 DRAW(DrawPaint, drawPaint(r.paint)); |
98 DRAW(DrawPath, drawPath(r.path, r.paint)); | 100 DRAW(DrawPath, drawPath(r.path, r.paint)); |
99 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); | 101 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); |
100 DRAW(DrawPicture, drawPicture(r.picture, r.matrix, r.paint)); | 102 DRAW(DrawPicture, drawPicture(r.picture, r.matrix, r.paint)); |
101 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); | 103 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); |
102 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); | 104 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); |
103 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); | 105 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); |
104 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); | 106 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); |
105 DRAW(DrawRect, drawRect(r.rect, r.paint)); | 107 DRAW(DrawRect, drawRect(r.rect, r.paint)); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 354 } |
353 | 355 |
354 Bounds bounds(const DrawRect& op) const { return this->adjustAndMap(op.rect,
&op.paint); } | 356 Bounds bounds(const DrawRect& op) const { return this->adjustAndMap(op.rect,
&op.paint); } |
355 Bounds bounds(const DrawOval& op) const { return this->adjustAndMap(op.oval,
&op.paint); } | 357 Bounds bounds(const DrawOval& op) const { return this->adjustAndMap(op.oval,
&op.paint); } |
356 Bounds bounds(const DrawRRect& op) const { | 358 Bounds bounds(const DrawRRect& op) const { |
357 return this->adjustAndMap(op.rrect.rect(), &op.paint); | 359 return this->adjustAndMap(op.rrect.rect(), &op.paint); |
358 } | 360 } |
359 Bounds bounds(const DrawDRRect& op) const { | 361 Bounds bounds(const DrawDRRect& op) const { |
360 return this->adjustAndMap(op.outer.rect(), &op.paint); | 362 return this->adjustAndMap(op.outer.rect(), &op.paint); |
361 } | 363 } |
| 364 Bounds bounds(const DrawImage& op) const { |
| 365 const SkImage* image = op.image; |
| 366 SkRect rect = SkRect::MakeXYWH(op.left, op.top, image->width(), image->h
eight()); |
362 | 367 |
| 368 return this->adjustAndMap(rect, op.paint); |
| 369 } |
| 370 Bounds bounds(const DrawImageRect& op) const { |
| 371 return this->adjustAndMap(op.dst, op.paint); |
| 372 } |
363 Bounds bounds(const DrawBitmapRectToRect& op) const { | 373 Bounds bounds(const DrawBitmapRectToRect& op) const { |
364 return this->adjustAndMap(op.dst, op.paint); | 374 return this->adjustAndMap(op.dst, op.paint); |
365 } | 375 } |
366 Bounds bounds(const DrawBitmapNine& op) const { | 376 Bounds bounds(const DrawBitmapNine& op) const { |
367 return this->adjustAndMap(op.dst, op.paint); | 377 return this->adjustAndMap(op.dst, op.paint); |
368 } | 378 } |
369 Bounds bounds(const DrawBitmap& op) const { | 379 Bounds bounds(const DrawBitmap& op) const { |
370 const SkBitmap& bm = op.bitmap; | 380 const SkBitmap& bm = op.bitmap; |
371 return this->adjustAndMap(SkRect::MakeXYWH(op.left, op.top, bm.width(),
bm.height()), | 381 return this->adjustAndMap(SkRect::MakeXYWH(op.left, op.top, bm.width(),
bm.height()), |
372 op.paint); | 382 op.paint); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. | 556 // Used to track the bounds of Save/Restore blocks and the control ops insid
e them. |
547 SkTDArray<SaveBounds> fSaveStack; | 557 SkTDArray<SaveBounds> fSaveStack; |
548 SkTDArray<unsigned> fControlIndices; | 558 SkTDArray<unsigned> fControlIndices; |
549 }; | 559 }; |
550 | 560 |
551 } // namespace SkRecords | 561 } // namespace SkRecords |
552 | 562 |
553 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { | 563 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { |
554 SkRecords::FillBounds(record, bbh); | 564 SkRecords::FillBounds(record, bbh); |
555 } | 565 } |
OLD | NEW |