Fix SkOneShotDiscardablePixelRef to return discardable segment.

The SkOneShotDiscardablePixelRef was not overriding
diagnostic_only_getDiscardable method of SkPixelRef. This caused the
memory to be acocunted under malloc instead of discardable and caused
wrong accounting.

BUG=528295

Review URL: https://codereview.chromium.org/1304083006
This commit is contained in:
ssid 2015-09-04 08:29:24 -07:00 committed by Commit bot
parent 55143211e9
commit 85237822b3

View File

@ -87,6 +87,8 @@ protected:
void onUnlockPixels() override; void onUnlockPixels() override;
size_t getAllocatedSizeInBytes() const override; size_t getAllocatedSizeInBytes() const override;
SkDiscardableMemory* diagnostic_only_getDiscardable() const override { return fDM; }
private: private:
SkDiscardableMemory* fDM; SkDiscardableMemory* fDM;
size_t fRB; size_t fRB;