This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ class SkFont;
41
41
class SkGlyphRunBuilder ;
42
42
class SkImage ;
43
43
class SkImageFilter ;
44
- class SkMetaData ;
45
44
class SkPath ;
46
45
class SkPicture ;
47
46
class SkPixmap ;
@@ -52,6 +51,10 @@ class SkSurface;
52
51
class SkSurface_Base ;
53
52
class SkTextBlob ;
54
53
54
+ #ifdef SK_SUPPORT_LEGACY_CANVAS_METADATA
55
+ class SkMetaData ;
56
+ #endif
57
+
55
58
/* * \class SkCanvas
56
59
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
57
60
SkCanvas contains a stack of SkMatrix and clip values.
@@ -217,13 +220,14 @@ class SK_API SkCanvas {
217
220
*/
218
221
virtual ~SkCanvas ();
219
222
223
+ #ifdef SK_SUPPORT_LEGACY_CANVAS_METADATA
220
224
/* * Returns storage to associate additional data with the canvas.
221
225
The storage is freed when SkCanvas is deleted.
222
226
223
227
@return storage that can be read from and written to
224
228
*/
225
229
SkMetaData& getMetaData ();
226
-
230
+ # endif
227
231
/* * Returns SkImageInfo for SkCanvas. If SkCanvas is not associated with raster surface or
228
232
GPU surface, returned SkColorType is set to kUnknown_SkColorType.
229
233
@@ -2519,7 +2523,9 @@ class SK_API SkCanvas {
2519
2523
2520
2524
int fSaveCount ; // value returned by getSaveCount()
2521
2525
2526
+ #ifdef SK_SUPPORT_LEGACY_CANVAS_METADATA
2522
2527
SkMetaData* fMetaData ;
2528
+ #endif
2523
2529
std::unique_ptr<SkRasterHandleAllocator> fAllocator ;
2524
2530
2525
2531
SkSurface_Base* fSurfaceBase ;
Original file line number Diff line number Diff line change @@ -551,7 +551,9 @@ void SkCanvas::resetForNextPicture(const SkIRect& bounds) {
551
551
void SkCanvas::init (sk_sp<SkBaseDevice> device) {
552
552
fAllowSimplifyClip = false ;
553
553
fSaveCount = 1 ;
554
+ #ifdef SK_SUPPORT_LEGACY_CANVAS_METADATA
554
555
fMetaData = nullptr ;
556
+ #endif
555
557
556
558
fMCRec = (MCRec*)fMCStack .push_back ();
557
559
new (fMCRec ) MCRec;
@@ -660,11 +662,14 @@ SkCanvas::~SkCanvas() {
660
662
661
663
this ->internalRestore (); // restore the last, since we're going away
662
664
665
+ #ifdef SK_SUPPORT_LEGACY_CANVAS_METADATA
663
666
delete fMetaData ;
667
+ #endif
664
668
665
669
dec_canvas ();
666
670
}
667
671
672
+ #ifdef SK_SUPPORT_LEGACY_CANVAS_METADATA
668
673
SkMetaData& SkCanvas::getMetaData () {
669
674
// metadata users are rare, so we lazily allocate it. If that changes we
670
675
// can decide to just make it a field in the device (rather than a ptr)
@@ -673,6 +678,7 @@ SkMetaData& SkCanvas::getMetaData() {
673
678
}
674
679
return *fMetaData ;
675
680
}
681
+ #endif
676
682
677
683
// /////////////////////////////////////////////////////////////////////////////
678
684
You can’t perform that action at this time.
0 commit comments