@@ -101,12 +101,12 @@ bool SkCanvas::wouldOverwriteEntireSurface(const SkRect* rect, const SkPaint* pa
101
101
102
102
// if we're clipped at all, we can't overwrite the entire surface
103
103
{
104
- const SkDevice* base = this ->baseDevice ();
104
+ const SkDevice* root = this ->rootDevice ();
105
105
const SkDevice* top = this ->topDevice ();
106
- if (base != top) {
106
+ if (root != top) {
107
107
return false ; // we're in a saveLayer, so conservatively don't assume we'll overwrite
108
108
}
109
- if (!base ->isClipWideOpen ()) {
109
+ if (!root ->isClipWideOpen ()) {
110
110
return false ;
111
111
}
112
112
}
@@ -267,11 +267,11 @@ void SkCanvas::resetForNextPicture(const SkIRect& bounds) {
267
267
268
268
// We're peering through a lot of structs here. Only at this scope do we
269
269
// know that the device is a SkNoPixelsDevice.
270
- SkASSERT (fBaseDevice ->isNoPixelsDevice ());
271
- fBaseDevice = sk_make_sp<SkNoPixelsDevice>(bounds,
272
- fBaseDevice ->surfaceProps (),
273
- fBaseDevice ->imageInfo ().refColorSpace ());
274
- fMCRec ->reset (fBaseDevice .get ());
270
+ SkASSERT (fRootDevice ->isNoPixelsDevice ());
271
+ fRootDevice = sk_make_sp<SkNoPixelsDevice>(bounds,
272
+ fRootDevice ->surfaceProps (),
273
+ fRootDevice ->imageInfo ().refColorSpace ());
274
+ fMCRec ->reset (fRootDevice .get ());
275
275
fQuickRejectBounds = this ->computeDeviceClipBounds ();
276
276
}
277
277
@@ -295,7 +295,7 @@ void SkCanvas::init(sk_sp<SkDevice> device) {
295
295
SkASSERT (fProps .pixelGeometry () == device->surfaceProps ().pixelGeometry ());
296
296
297
297
fSurfaceBase = nullptr ;
298
- fBaseDevice = std::move (device);
298
+ fRootDevice = std::move (device);
299
299
fScratchGlyphRunBuilder = std::make_unique<sktext::GlyphRunBuilder>();
300
300
fQuickRejectBounds = this ->computeDeviceClipBounds ();
301
301
}
@@ -346,7 +346,7 @@ SkSurface* SkCanvas::getSurface() const {
346
346
}
347
347
348
348
SkISize SkCanvas::getBaseLayerSize () const {
349
- return this ->baseDevice ()->imageInfo ().dimensions ();
349
+ return this ->rootDevice ()->imageInfo ().dimensions ();
350
350
}
351
351
352
352
SkDevice* SkCanvas::topDevice () const {
@@ -355,7 +355,7 @@ SkDevice* SkCanvas::topDevice() const {
355
355
}
356
356
357
357
bool SkCanvas::readPixels (const SkPixmap& pm, int x, int y) {
358
- return pm.addr () && this ->baseDevice ()->readPixels (pm, x, y);
358
+ return pm.addr () && this ->rootDevice ()->readPixels (pm, x, y);
359
359
}
360
360
361
361
bool SkCanvas::readPixels (const SkImageInfo& dstInfo, void * dstP, size_t rowBytes, int x, int y) {
@@ -377,7 +377,7 @@ bool SkCanvas::writePixels(const SkBitmap& bitmap, int x, int y) {
377
377
378
378
bool SkCanvas::writePixels (const SkImageInfo& srcInfo, const void * pixels, size_t rowBytes,
379
379
int x, int y) {
380
- SkDevice* device = this ->baseDevice ();
380
+ SkDevice* device = this ->rootDevice ();
381
381
382
382
// This check gives us an early out and prevents generation ID churn on the surface.
383
383
// This is purely optional: it is a subset of the checks performed by SkWritePixelsRec.
@@ -1156,15 +1156,15 @@ sk_sp<SkSurface> SkCanvas::makeSurface(const SkImageInfo& info, const SkSurfaceP
1156
1156
}
1157
1157
1158
1158
sk_sp<SkSurface> SkCanvas::onNewSurface (const SkImageInfo& info, const SkSurfaceProps& props) {
1159
- return this ->baseDevice ()->makeSurface (info, props);
1159
+ return this ->rootDevice ()->makeSurface (info, props);
1160
1160
}
1161
1161
1162
1162
SkImageInfo SkCanvas::imageInfo () const {
1163
1163
return this ->onImageInfo ();
1164
1164
}
1165
1165
1166
1166
SkImageInfo SkCanvas::onImageInfo () const {
1167
- return this ->baseDevice ()->imageInfo ();
1167
+ return this ->rootDevice ()->imageInfo ();
1168
1168
}
1169
1169
1170
1170
bool SkCanvas::getProps (SkSurfaceProps* props) const {
@@ -1195,7 +1195,7 @@ bool SkCanvas::peekPixels(SkPixmap* pmap) {
1195
1195
}
1196
1196
1197
1197
bool SkCanvas::onPeekPixels (SkPixmap* pmap) {
1198
- return this ->baseDevice ()->peekPixels (pmap);
1198
+ return this ->rootDevice ()->peekPixels (pmap);
1199
1199
}
1200
1200
1201
1201
void * SkCanvas::accessTopLayerPixels (SkImageInfo* info, size_t * rowBytes, SkIPoint* origin) {
@@ -1354,7 +1354,7 @@ void SkCanvas::androidFramework_setDeviceClipRestriction(const SkIRect& rect) {
1354
1354
// - Historically, the empty rect would reset the clip restriction but it only could do so
1355
1355
// partially since the device's clips wasn't adjusted. Resetting is now handled
1356
1356
// automatically via SkCanvas::restore(), so empty input rects are skipped.
1357
- SkASSERT (this ->topDevice () == this ->baseDevice ()); // shouldn't be in a nested layer
1357
+ SkASSERT (this ->topDevice () == this ->rootDevice ()); // shouldn't be in a nested layer
1358
1358
// and shouldn't already have a restriction
1359
1359
SkASSERT (fClipRestrictionSaveCount < 0 && fClipRestrictionRect .isEmpty ());
1360
1360
@@ -1379,7 +1379,7 @@ void SkCanvas::internal_private_resetClip() {
1379
1379
1380
1380
void SkCanvas::onResetClip () {
1381
1381
SkIRect deviceRestriction = this ->topDevice ()->imageInfo ().bounds ();
1382
- if (fClipRestrictionSaveCount >= 0 && this ->topDevice () == this ->baseDevice ()) {
1382
+ if (fClipRestrictionSaveCount >= 0 && this ->topDevice () == this ->rootDevice ()) {
1383
1383
// Respect the device clip restriction when resetting the clip if we're on the base device.
1384
1384
// If we're not on the base device, then the "reset" applies to the top device's clip stack,
1385
1385
// and the clip restriction will be respected automatically during a restore of the layer.
0 commit comments