OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "SkLiteDL.h" | 8 #include "SkLiteDL.h" |
9 #include "SkLiteRecorder.h" | 9 #include "SkLiteRecorder.h" |
10 #include "SkSurface.h" | 10 #include "SkSurface.h" |
11 | 11 |
12 SkLiteRecorder::SkLiteRecorder() | 12 SkLiteRecorder::SkLiteRecorder() |
13 : SkCanvas({0,0,1,1}, SkCanvas::kConservativeRasterClip_InitFlag) | 13 : SkCanvas({0,0,1,1}, SkCanvas::kConservativeRasterClip_InitFlag) |
14 , fDL(nullptr) {} | 14 , fDL(nullptr) {} |
15 | 15 |
16 void SkLiteRecorder::reset(SkLiteDL* dl) { | 16 void SkLiteRecorder::reset(SkLiteDL* dl) { |
17 this->resetForNextPicture(dl->getBounds().roundOut()); | 17 this->resetForNextPicture(dl->getBounds().roundOut()); |
18 fDL = dl; | 18 fDL = dl; |
19 } | 19 } |
20 | 20 |
21 sk_sp<SkSurface> SkLiteRecorder::onNewSurface(const SkImageInfo&, const SkSurfac
eProps&) { | 21 sk_sp<SkSurface> SkLiteRecorder::onNewSurface(const SkImageInfo&, const SkSurfac
eProps&) { |
22 return nullptr; | 22 return nullptr; |
23 } | 23 } |
24 | 24 |
| 25 #ifdef SK_SUPPORT_LEGACY_DRAWFILTER |
| 26 SkDrawFilter* SkLiteRecorder::setDrawFilter(SkDrawFilter* df) { |
| 27 fDL->setDrawFilter(df); |
| 28 return SkCanvas::setDrawFilter(df); |
| 29 } |
| 30 #endif |
| 31 |
25 void SkLiteRecorder::willSave() { fDL->save(); } | 32 void SkLiteRecorder::willSave() { fDL->save(); } |
26 SkCanvas::SaveLayerStrategy SkLiteRecorder::getSaveLayerStrategy(const SaveLayer
Rec& rec) { | 33 SkCanvas::SaveLayerStrategy SkLiteRecorder::getSaveLayerStrategy(const SaveLayer
Rec& rec) { |
27 fDL->saveLayer(rec.fBounds, rec.fPaint, rec.fBackdrop, rec.fSaveLayerFlags); | 34 fDL->saveLayer(rec.fBounds, rec.fPaint, rec.fBackdrop, rec.fSaveLayerFlags); |
28 return SkCanvas::kNoLayer_SaveLayerStrategy; | 35 return SkCanvas::kNoLayer_SaveLayerStrategy; |
29 } | 36 } |
30 void SkLiteRecorder::willRestore() { fDL->restore(); } | 37 void SkLiteRecorder::willRestore() { fDL->restore(); } |
31 | 38 |
32 void SkLiteRecorder::didConcat (const SkMatrix& matrix) { fDL-> concat(mat
rix); } | 39 void SkLiteRecorder::didConcat (const SkMatrix& matrix) { fDL-> concat(mat
rix); } |
33 void SkLiteRecorder::didSetMatrix(const SkMatrix& matrix) { fDL->setMatrix(mat
rix); } | 40 void SkLiteRecorder::didSetMatrix(const SkMatrix& matrix) { fDL->setMatrix(mat
rix); } |
34 void SkLiteRecorder::didTranslate(SkScalar dx, SkScalar dy) { fDL->translate(dx,
dy); } | 41 void SkLiteRecorder::didTranslate(SkScalar dx, SkScalar dy) { fDL->translate(dx,
dy); } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 196 |
190 void SkLiteRecorder::didTranslateZ(SkScalar dz) { | 197 void SkLiteRecorder::didTranslateZ(SkScalar dz) { |
191 fDL->translateZ(dz); | 198 fDL->translateZ(dz); |
192 } | 199 } |
193 void SkLiteRecorder::onDrawShadowedPicture(const SkPicture* picture, | 200 void SkLiteRecorder::onDrawShadowedPicture(const SkPicture* picture, |
194 const SkMatrix* matrix, | 201 const SkMatrix* matrix, |
195 const SkPaint* paint, | 202 const SkPaint* paint, |
196 const SkShadowParams& params) { | 203 const SkShadowParams& params) { |
197 fDL->drawShadowedPicture(picture, matrix, paint, params); | 204 fDL->drawShadowedPicture(picture, matrix, paint, params); |
198 } | 205 } |
OLD | NEW |