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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); | 113 DRAW(DrawPosText, drawPosText(r.text, r.byteLength, r.pos, r.paint)); |
114 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); | 114 DRAW(DrawPosTextH, drawPosTextH(r.text, r.byteLength, r.xpos, r.y, r.paint)); |
115 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); | 115 DRAW(DrawRRect, drawRRect(r.rrect, r.paint)); |
116 DRAW(DrawRect, drawRect(r.rect, r.paint)); | 116 DRAW(DrawRect, drawRect(r.rect, r.paint)); |
117 DRAW(DrawSprite, drawSprite(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); | 117 DRAW(DrawSprite, drawSprite(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); |
118 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); | 118 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); |
119 DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint)); | 119 DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint)); |
120 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.p
aint)); | 120 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.p
aint)); |
121 DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.co
lors, | 121 DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.co
lors, |
122 r.xmode.get(), r.indices, r.indexCount, r.paint)
); | 122 r.xmode.get(), r.indices, r.indexCount, r.paint)
); |
123 DRAW(DrawData, drawData(r.data, r.length)); | |
124 #undef DRAW | 123 #undef DRAW |
125 | 124 |
126 template <> void Draw::draw(const DrawDrawable& r) { | 125 template <> void Draw::draw(const DrawDrawable& r) { |
127 SkASSERT(r.index >= 0); | 126 SkASSERT(r.index >= 0); |
128 SkASSERT(r.index < fDrawableCount); | 127 SkASSERT(r.index < fDrawableCount); |
129 if (fDrawables) { | 128 if (fDrawables) { |
130 SkASSERT(NULL == fDrawablePicts); | 129 SkASSERT(NULL == fDrawablePicts); |
131 fCanvas->EXPERIMENTAL_drawDrawable(fDrawables[r.index]); | 130 fCanvas->EXPERIMENTAL_drawDrawable(fDrawables[r.index]); |
132 } else { | 131 } else { |
133 fCanvas->drawPicture(fDrawablePicts[r.index]); | 132 fCanvas->drawPicture(fDrawablePicts[r.index]); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 void trackBounds(const Restore&) { fBounds[fCurrentOp] = this->popSaveBlock(
); } | 282 void trackBounds(const Restore&) { fBounds[fCurrentOp] = this->popSaveBlock(
); } |
284 | 283 |
285 void trackBounds(const SetMatrix&) { this->pushControl(); } | 284 void trackBounds(const SetMatrix&) { this->pushControl(); } |
286 void trackBounds(const ClipRect&) { this->pushControl(); } | 285 void trackBounds(const ClipRect&) { this->pushControl(); } |
287 void trackBounds(const ClipRRect&) { this->pushControl(); } | 286 void trackBounds(const ClipRRect&) { this->pushControl(); } |
288 void trackBounds(const ClipPath&) { this->pushControl(); } | 287 void trackBounds(const ClipPath&) { this->pushControl(); } |
289 void trackBounds(const ClipRegion&) { this->pushControl(); } | 288 void trackBounds(const ClipRegion&) { this->pushControl(); } |
290 void trackBounds(const BeginCommentGroup&) { this->pushControl(); } | 289 void trackBounds(const BeginCommentGroup&) { this->pushControl(); } |
291 void trackBounds(const AddComment&) { this->pushControl(); } | 290 void trackBounds(const AddComment&) { this->pushControl(); } |
292 void trackBounds(const EndCommentGroup&) { this->pushControl(); } | 291 void trackBounds(const EndCommentGroup&) { this->pushControl(); } |
293 void trackBounds(const DrawData&) { this->pushControl(); } | |
294 | 292 |
295 // For all other ops, we can calculate and store the bounds directly now. | 293 // For all other ops, we can calculate and store the bounds directly now. |
296 template <typename T> void trackBounds(const T& op) { | 294 template <typename T> void trackBounds(const T& op) { |
297 fBounds[fCurrentOp] = this->bounds(op); | 295 fBounds[fCurrentOp] = this->bounds(op); |
298 this->updateSaveBounds(fBounds[fCurrentOp]); | 296 this->updateSaveBounds(fBounds[fCurrentOp]); |
299 } | 297 } |
300 | 298 |
301 void pushSaveBlock(const SkPaint* paint) { | 299 void pushSaveBlock(const SkPaint* paint) { |
302 // Starting a new Save block. Push a new entry to represent that. | 300 // Starting a new Save block. Push a new entry to represent that. |
303 SaveBounds sb; | 301 SaveBounds sb; |
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); | 792 SkRecords::CollectLayers visitor(cullRect, record, pictList, data); |
795 | 793 |
796 for (unsigned curOp = 0; curOp < record.count(); curOp++) { | 794 for (unsigned curOp = 0; curOp < record.count(); curOp++) { |
797 visitor.setCurrentOp(curOp); | 795 visitor.setCurrentOp(curOp); |
798 record.visit<void>(curOp, visitor); | 796 record.visit<void>(curOp, visitor); |
799 } | 797 } |
800 | 798 |
801 visitor.cleanUp(bbh); | 799 visitor.cleanUp(bbh); |
802 } | 800 } |
803 | 801 |
OLD | NEW |