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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 | 72 |
73 namespace SkRecords { | 73 namespace SkRecords { |
74 | 74 |
75 // NoOps draw nothing. | 75 // NoOps draw nothing. |
76 template <> void Draw::draw(const NoOp&) {} | 76 template <> void Draw::draw(const NoOp&) {} |
77 | 77 |
78 #define DRAW(T, call) template <> void Draw::draw(const T& r) { fCanvas->call; } | 78 #define DRAW(T, call) template <> void Draw::draw(const T& r) { fCanvas->call; } |
79 DRAW(Restore, restore()); | 79 DRAW(Restore, restore()); |
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.saveLayerF
lags))); |
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(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); | 90 DRAW(DrawBitmap, drawBitmap(r.bitmap.shallowCopy(), r.left, r.top, r.paint)); |
91 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)); |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec
t bounds[], | 800 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRec
t bounds[], |
801 const SkBigPicture::SnapshotArray* pictList, SkLayerI
nfo* data) { | 801 const SkBigPicture::SnapshotArray* pictList, SkLayerI
nfo* data) { |
802 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data); | 802 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data); |
803 for (int curOp = 0; curOp < record.count(); curOp++) { | 803 for (int curOp = 0; curOp < record.count(); curOp++) { |
804 visitor.setCurrentOp(curOp); | 804 visitor.setCurrentOp(curOp); |
805 record.visit<void>(curOp, visitor); | 805 record.visit<void>(curOp, visitor); |
806 } | 806 } |
807 visitor.cleanUp(); | 807 visitor.cleanUp(); |
808 } | 808 } |
809 | 809 |
OLD | NEW |