Skip to content

Commit 7839f66

Browse files
lhkbobSkia Commit-Bot
authored and
Skia Commit-Bot
committed
Reland "Rename getTopDevice/getDevice to topDevice/baseDevice"
This reverts commit d8b939e. Reason for revert: fix SkAndroidFrameworkUtils getDevice() reference Original change's description: > Revert "Rename getTopDevice/getDevice to topDevice/baseDevice" > > This reverts commit 632a23a. > > Reason for revert: breaking android roll > > Original change's description: > > Rename getTopDevice/getDevice to topDevice/baseDevice > > > > This addresses nit from https://skia-review.googlesource.com/c/skia/+/344663 > > and also moves topDevice() to be private, since it's not really meant > > for arbitrary subclasses to access anyways. Classes outside of SkCanvas > > that need topDevice/baseDevice are already friended anyways. > > > > Bug: skia:10987 > > Change-Id: Ib0b0dffb5b1c35d5a0c78aeb8903e4cf0b8810a9 > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344960 > > Reviewed-by: Mike Klein <[email protected]> > > Reviewed-by: Mike Reed <[email protected]> > > Commit-Queue: Michael Ludwig <[email protected]> > > [email protected],[email protected],[email protected] > > Change-Id: I9b70230f7db5d31cede2ea03e7abc7c154021204 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:10987 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345158 > Reviewed-by: Derek Sollenberger <[email protected]> > Commit-Queue: Derek Sollenberger <[email protected]> [email protected],[email protected],[email protected],[email protected] # Not skipping CQ checks because this is a reland. Bug: skia:10987 Change-Id: Ibf6397b54655c25ef3d348210de5eb6dab416723 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345165 Reviewed-by: Michael Ludwig <[email protected]> Commit-Queue: Michael Ludwig <[email protected]>
1 parent 1d89532 commit 7839f66

File tree

5 files changed

+91
-85
lines changed

5 files changed

+91
-85
lines changed

include/core/SkCanvas.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2573,8 +2573,6 @@ class SK_API SkCanvas {
25732573
bool clipRectBounds(const SkRect* bounds, SkIRect* intersection,
25742574
const SkImageFilter* imageFilter = nullptr);
25752575

2576-
SkBaseDevice* getTopDevice() const;
2577-
25782576
private:
25792577
static void DrawDeviceWithFilter(SkBaseDevice* src, const SkImageFilter* filter,
25802578
SkBaseDevice* dst, const SkIPoint& dstOrigin,
@@ -2591,7 +2589,15 @@ class SK_API SkCanvas {
25912589
void predrawNotify(bool willOverwritesEntireSurface = false);
25922590
void predrawNotify(const SkRect* rect, const SkPaint* paint, ShaderOverrideOpacity);
25932591

2594-
SkBaseDevice* getDevice() const;
2592+
// The bottom-most device in the stack, only changed by init(). Image properties and the final
2593+
// canvas pixels are determined by this device.
2594+
SkBaseDevice* baseDevice();
2595+
const SkBaseDevice* baseDevice() const;
2596+
2597+
// The top-most device in the stack, will change within saveLayer()'s. All drawing and clipping
2598+
// operations should route to this device.
2599+
SkBaseDevice* topDevice();
2600+
const SkBaseDevice* topDevice() const;
25952601

25962602
class MCRec;
25972603

src/android/SkAndroidFrameworkUtils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717

1818
#if SK_SUPPORT_GPU
1919
bool SkAndroidFrameworkUtils::clipWithStencil(SkCanvas* canvas) {
20-
SkBaseDevice* device = canvas->getDevice();
21-
return device && device->android_utils_clipWithStencil();
20+
return canvas->baseDevice()->android_utils_clipWithStencil();
2221
}
2322
#endif
2423

0 commit comments

Comments
 (0)