Hide SkCanvas getDevice() & getTopDevice()}
authorFlorin Malita <fmalita@chromium.org>
Thu, 12 Jan 2017 21:01:30 +0000 (16:01 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 13 Jan 2017 14:09:20 +0000 (14:09 +0000)
No longer used externally.

R=reed@google.com

Change-Id: I450148010852c2567d136d2c85c8837c6dcbc6b9
Reviewed-on: https://skia-review.googlesource.com/6974
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>

include/core/SkCanvas.h
src/core/SkCanvas.cpp

index 704584a..909bbac 100644 (file)
@@ -157,36 +157,6 @@ public:
     SkISize getDeviceSize() const { return this->getBaseLayerSize(); }
 
     /**
-     *  DEPRECATED.
-     *  Return the canvas' device object, which may be null. The device holds
-     *  the bitmap of the pixels that the canvas draws into. The reference count
-     *  of the returned device is not changed by this call.
-     */
-#ifndef SK_SUPPORT_LEGACY_GETDEVICE
-protected:  // Can we make this private?
-#endif
-    SkBaseDevice* getDevice() const;
-public:
-    /**
-     *  saveLayer() can create another device (which is later drawn onto
-     *  the previous device). getTopDevice() returns the top-most device current
-     *  installed. Note that this can change on other calls like save/restore,
-     *  so do not access this device after subsequent canvas calls.
-     *  The reference count of the device is not changed.
-     *
-     * @param updateMatrixClip If this is true, then before the device is
-     *        returned, we ensure that its has been notified about the current
-     *        matrix and clip. Note: this happens automatically when the device
-     *        is drawn to, but is optional here, as there is a small perf hit
-     *        sometimes.
-     */
-#ifndef SK_SUPPORT_LEGACY_GETTOPDEVICE
-private:
-#endif
-    SkBaseDevice* getTopDevice(bool updateMatrixClip = false) const;
-public:
-
-    /**
      *  Create a new surface matching the specified info, one that attempts to
      *  be maximally compatible when used with this canvas. If there is no matching Surface type,
      *  NULL is returned.
@@ -1552,6 +1522,9 @@ private:
                                                                 : kNotOpaque_ShaderOverrideOpacity);
     }
 
+    SkBaseDevice* getDevice() const;
+    SkBaseDevice* getTopDevice() const;
+
     class MCRec;
 
     sk_sp<SkClipStack> fClipStack;
index 067ccdc..e3374dd 100644 (file)
@@ -853,10 +853,7 @@ SkBaseDevice* SkCanvas::getDevice() const {
     return rec->fLayer->fDevice;
 }
 
-SkBaseDevice* SkCanvas::getTopDevice(bool updateMatrixClip) const {
-    if (updateMatrixClip) {
-        const_cast<SkCanvas*>(this)->updateDeviceCMCache();
-    }
+SkBaseDevice* SkCanvas::getTopDevice() const {
     return fMCRec->fTopLayer->fDevice;
 }
 
@@ -1403,7 +1400,7 @@ void* SkCanvas::accessTopLayerPixels(SkImageInfo* info, size_t* rowBytes, SkIPoi
         *rowBytes = pmap.rowBytes();
     }
     if (origin) {
-        *origin = this->getTopDevice(false)->getOrigin();
+        *origin = this->getTopDevice()->getOrigin();
     }
     return pmap.writable_addr();
 }