Chromium Code Reviews| 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 #include "SkTLogic.h" | 10 #include "SkTLogic.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 DRAW(BeginCommentGroup, beginCommentGroup(r.description)); | 87 DRAW(BeginCommentGroup, beginCommentGroup(r.description)); |
| 88 DRAW(AddComment, addComment(r.key, r.value)); | 88 DRAW(AddComment, addComment(r.key, r.value)); |
| 89 DRAW(EndCommentGroup, endCommentGroup()); | 89 DRAW(EndCommentGroup, endCommentGroup()); |
| 90 | 90 |
| 91 DRAW(DrawBitmap, drawBitmap(shallow_copy(r.bitmap), r.left, r.top, r.paint)); | 91 DRAW(DrawBitmap, drawBitmap(shallow_copy(r.bitmap), r.left, r.top, r.paint)); |
| 92 DRAW(DrawBitmapMatrix, drawBitmapMatrix(shallow_copy(r.bitmap), r.matrix, r.pain t)); | 92 DRAW(DrawBitmapMatrix, drawBitmapMatrix(shallow_copy(r.bitmap), r.matrix, r.pain t)); |
| 93 DRAW(DrawBitmapNine, drawBitmapNine(shallow_copy(r.bitmap), r.center, r.dst, r.p aint)); | 93 DRAW(DrawBitmapNine, drawBitmapNine(shallow_copy(r.bitmap), r.center, r.dst, r.p aint)); |
| 94 DRAW(DrawBitmapRectToRect, | 94 DRAW(DrawBitmapRectToRect, |
| 95 drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, r.fl ags)); | 95 drawBitmapRectToRect(shallow_copy(r.bitmap), r.src, r.dst, r.paint, r.fl ags)); |
| 96 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); | 96 DRAW(DrawDRRect, drawDRRect(r.outer, r.inner, r.paint)); |
| 97 DRAW(DrawImage, drawImage(r.image, r.left, r.top, r.paint)); | |
| 98 DRAW(DrawImageRect, drawImageRect(r.image, r.src, r.dst, r.paint)); | |
| 97 DRAW(DrawOval, drawOval(r.oval, r.paint)); | 99 DRAW(DrawOval, drawOval(r.oval, r.paint)); |
| 98 DRAW(DrawPaint, drawPaint(r.paint)); | 100 DRAW(DrawPaint, drawPaint(r.paint)); |
| 99 DRAW(DrawPath, drawPath(r.path, r.paint)); | 101 DRAW(DrawPath, drawPath(r.path, r.paint)); |
| 100 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); | 102 DRAW(DrawPatch, drawPatch(r.cubics, r.colors, r.texCoords, r.xmode, r.paint)); |
| 101 DRAW(DrawPicture, drawPicture(r.picture, r.matrix, r.paint)); | 103 DRAW(DrawPicture, drawPicture(r.picture, r.matrix, r.paint)); |
| 102 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); | 104 DRAW(DrawPoints, drawPoints(r.mode, r.count, r.pts, r.paint)); |
| 103 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); | 105 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); |
| 104 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); | 106 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); |
| 105 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); | 107 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); |
| 106 DRAW(DrawRect, drawRect(r.rect, r.paint)); | 108 DRAW(DrawRect, drawRect(r.rect, r.paint)); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 } | 334 } |
| 333 | 335 |
| 334 Bounds bounds(const DrawRect& op) const { return this->adjustAndMap(op.rect, &op.paint); } | 336 Bounds bounds(const DrawRect& op) const { return this->adjustAndMap(op.rect, &op.paint); } |
| 335 Bounds bounds(const DrawOval& op) const { return this->adjustAndMap(op.oval, &op.paint); } | 337 Bounds bounds(const DrawOval& op) const { return this->adjustAndMap(op.oval, &op.paint); } |
| 336 Bounds bounds(const DrawRRect& op) const { | 338 Bounds bounds(const DrawRRect& op) const { |
| 337 return this->adjustAndMap(op.rrect.rect(), &op.paint); | 339 return this->adjustAndMap(op.rrect.rect(), &op.paint); |
| 338 } | 340 } |
| 339 Bounds bounds(const DrawDRRect& op) const { | 341 Bounds bounds(const DrawDRRect& op) const { |
| 340 return this->adjustAndMap(op.outer.rect(), &op.paint); | 342 return this->adjustAndMap(op.outer.rect(), &op.paint); |
| 341 } | 343 } |
| 342 | 344 Bounds bounds(const DrawImage& op) const { |
| 345 const SkImage* image = op.image; | |
| 346 return this->adjustAndMap(SkRect::MakeXYWH(op.left, op.top, image->width (), image->height()), | |
|
mtklein
2014/09/27 15:41:22
May be over 100 cols here?
Rémi Piotaix
2014/09/29 17:57:54
Yes, 101 :-@
Done.
| |
| 347 op.paint); | |
| 348 } | |
| 349 Bounds bounds(const DrawImageRect& op) const { | |
| 350 return this->adjustAndMap(op.dst, op.paint); | |
| 351 } | |
| 343 Bounds bounds(const DrawBitmapRectToRect& op) const { | 352 Bounds bounds(const DrawBitmapRectToRect& op) const { |
| 344 return this->adjustAndMap(op.dst, op.paint); | 353 return this->adjustAndMap(op.dst, op.paint); |
| 345 } | 354 } |
| 346 Bounds bounds(const DrawBitmapNine& op) const { | 355 Bounds bounds(const DrawBitmapNine& op) const { |
| 347 return this->adjustAndMap(op.dst, op.paint); | 356 return this->adjustAndMap(op.dst, op.paint); |
| 348 } | 357 } |
| 349 Bounds bounds(const DrawBitmap& op) const { | 358 Bounds bounds(const DrawBitmap& op) const { |
| 350 const SkBitmap& bm = op.bitmap; | 359 const SkBitmap& bm = op.bitmap; |
| 351 return this->adjustAndMap(SkRect::MakeXYWH(op.left, op.top, bm.width(), bm.height()), | 360 return this->adjustAndMap(SkRect::MakeXYWH(op.left, op.top, bm.width(), bm.height()), |
| 352 op.paint); | 361 op.paint); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 526 // Used to track the bounds of Save/Restore blocks and the control ops insid e them. | 535 // Used to track the bounds of Save/Restore blocks and the control ops insid e them. |
| 527 SkTDArray<SaveBounds> fSaveStack; | 536 SkTDArray<SaveBounds> fSaveStack; |
| 528 SkTDArray<unsigned> fControlIndices; | 537 SkTDArray<unsigned> fControlIndices; |
| 529 }; | 538 }; |
| 530 | 539 |
| 531 } // namespace SkRecords | 540 } // namespace SkRecords |
| 532 | 541 |
| 533 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { | 542 void SkRecordFillBounds(const SkRecord& record, SkBBoxHierarchy* bbh) { |
| 534 SkRecords::FillBounds(record, bbh); | 543 SkRecords::FillBounds(record, bbh); |
| 535 } | 544 } |
| OLD | NEW |