| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 DRAW(Save, save()); | 80 DRAW(Save, save()); |
| 81 DRAW(SaveLayer, saveLayer(SkCanvas::SaveLayerRec(r.bounds, r.paint, r.backdrop,
r.saveLayerFlags))); | 81 DRAW(SaveLayer, saveLayer(SkCanvas::SaveLayerRec(r.bounds, r.paint, r.backdrop,
r.saveLayerFlags))); |
| 82 DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix))); | 82 DRAW(SetMatrix, setMatrix(SkMatrix::Concat(fInitialCTM, r.matrix))); |
| 83 DRAW(Concat, concat(r.matrix)); | 83 DRAW(Concat, concat(r.matrix)); |
| 84 | 84 |
| 85 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa)); | 85 DRAW(ClipPath, clipPath(r.path, r.opAA.op, r.opAA.aa)); |
| 86 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); | 86 DRAW(ClipRRect, clipRRect(r.rrect, r.opAA.op, r.opAA.aa)); |
| 87 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); | 87 DRAW(ClipRect, clipRect(r.rect, r.opAA.op, r.opAA.aa)); |
| 88 DRAW(ClipRegion, clipRegion(r.region, r.op)); | 88 DRAW(ClipRegion, clipRegion(r.region, r.op)); |
| 89 | 89 |
| 90 DRAW(TranslateZ, SkCanvas::translateZ(r.z)); | |
| 91 | |
| 92 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); | 90 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); |
| 93 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p
aint)); | 91 DRAW(DrawBitmapNine, drawBitmapNine(r.bitmap.shallowCopy(), r.center, r.dst, r.p
aint)); |
| 94 DRAW(DrawBitmapRect, | 92 DRAW(DrawBitmapRect, |
| 95 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, | 93 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, |
| 96 SkCanvas::kStrict_SrcRectConstraint)); | 94 SkCanvas::kStrict_SrcRectConstraint)); |
| 97 DRAW(DrawBitmapRectFast, | 95 DRAW(DrawBitmapRectFast, |
| 98 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, | 96 legacy_drawBitmapRect(r.bitmap.shallowCopy(), r.src, r.dst, r.paint, |
| 99 SkCanvas::kFast_SrcRectConstraint)); | 97 SkCanvas::kFast_SrcRectConstraint)); |
| 100 DRAW(DrawBitmapRectFixedSize, | 98 DRAW(DrawBitmapRectFixedSize, |
| 101 legacy_drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r
.constraint)); | 99 legacy_drawBitmapRect(r.bitmap.shallowCopy(), &r.src, r.dst, &r.paint, r
.constraint)); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 void trackBounds(const SaveLayer& op) { this->pushSaveBlock(op.paint); } | 281 void trackBounds(const SaveLayer& op) { this->pushSaveBlock(op.paint); } |
| 284 void trackBounds(const Restore&) { fBounds[fCurrentOp] = this->popSaveBlock(
); } | 282 void trackBounds(const Restore&) { fBounds[fCurrentOp] = this->popSaveBlock(
); } |
| 285 | 283 |
| 286 void trackBounds(const SetMatrix&) { this->pushControl(); } | 284 void trackBounds(const SetMatrix&) { this->pushControl(); } |
| 287 void trackBounds(const Concat&) { this->pushControl(); } | 285 void trackBounds(const Concat&) { this->pushControl(); } |
| 288 void trackBounds(const ClipRect&) { this->pushControl(); } | 286 void trackBounds(const ClipRect&) { this->pushControl(); } |
| 289 void trackBounds(const ClipRRect&) { this->pushControl(); } | 287 void trackBounds(const ClipRRect&) { this->pushControl(); } |
| 290 void trackBounds(const ClipPath&) { this->pushControl(); } | 288 void trackBounds(const ClipPath&) { this->pushControl(); } |
| 291 void trackBounds(const ClipRegion&) { this->pushControl(); } | 289 void trackBounds(const ClipRegion&) { this->pushControl(); } |
| 292 | 290 |
| 293 void trackBounds(const TranslateZ&) { this->pushControl(); } | |
| 294 | |
| 295 // For all other ops, we can calculate and store the bounds directly now. | 291 // For all other ops, we can calculate and store the bounds directly now. |
| 296 template <typename T> void trackBounds(const T& op) { | 292 template <typename T> void trackBounds(const T& op) { |
| 297 fBounds[fCurrentOp] = this->bounds(op); | 293 fBounds[fCurrentOp] = this->bounds(op); |
| 298 this->updateSaveBounds(fBounds[fCurrentOp]); | 294 this->updateSaveBounds(fBounds[fCurrentOp]); |
| 299 } | 295 } |
| 300 | 296 |
| 301 void pushSaveBlock(const SkPaint* paint) { | 297 void pushSaveBlock(const SkPaint* paint) { |
| 302 // Starting a new Save block. Push a new entry to represent that. | 298 // Starting a new Save block. Push a new entry to represent that. |
| 303 SaveBounds sb; | 299 SaveBounds sb; |
| 304 sb.controlOps = 0; | 300 sb.controlOps = 0; |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 | 815 |
| 820 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec
t bounds[], | 816 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec
t bounds[], |
| 821 const SkBigPicture::SnapshotArray* pictList, SkLayerI
nfo* data) { | 817 const SkBigPicture::SnapshotArray* pictList, SkLayerI
nfo* data) { |
| 822 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data); | 818 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data); |
| 823 for (int curOp = 0; curOp < record.count(); curOp++) { | 819 for (int curOp = 0; curOp < record.count(); curOp++) { |
| 824 visitor.setCurrentOp(curOp); | 820 visitor.setCurrentOp(curOp); |
| 825 record.visit(curOp, visitor); | 821 record.visit(curOp, visitor); |
| 826 } | 822 } |
| 827 visitor.cleanUp(); | 823 visitor.cleanUp(); |
| 828 } | 824 } |
| OLD | NEW |