aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-09-25 06:56:57 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-09-25 06:56:57 -0700
commitd114645d931d4e95a938597a45a270f211273c17 (patch)
tree195585704f873e84248a8c44e80c366025066ba2
parent57b767127f88b4794f7e42e659b585b3b82203c5 (diff)
SkInstallDiscardablePixelRef is deprecated, enforce that
No functionality change, just a renaming. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1372593002
-rw-r--r--dm/DMSrcSink.cpp2
-rw-r--r--gm/factory.cpp3
-rw-r--r--include/core/SkImageGenerator.h4
-rw-r--r--src/core/SkImageGeneratorPriv.h5
-rw-r--r--src/core/SkPictureShader.cpp2
-rw-r--r--src/lazy/SkDiscardablePixelRef.cpp13
-rw-r--r--src/lazy/SkDiscardablePixelRef.h2
-rw-r--r--tests/CachedDecodingPixelRefTest.cpp4
-rw-r--r--tests/KtxTest.cpp2
-rw-r--r--tests/PDFJpegEmbedTest.cpp2
-rw-r--r--tests/PictureTest.cpp2
-rw-r--r--tools/LazyDecodeBitmap.cpp2
-rw-r--r--tools/flatten.cpp2
13 files changed, 24 insertions, 21 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index a4e240bbaa..e5faed7da1 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -34,7 +34,7 @@ DEFINE_bool(multiPage, false, "For document-type backends, render the source"
static bool lazy_decode_bitmap(const void* src, size_t size, SkBitmap* dst) {
SkAutoTUnref<SkData> encoded(SkData::NewWithCopy(src, size));
- return encoded && SkInstallDiscardablePixelRef(encoded, dst);
+ return encoded && SkDEPRECATED_InstallDiscardablePixelRef(encoded, dst);
}
namespace DM {
diff --git a/gm/factory.cpp b/gm/factory.cpp
index 66cb65ee24..4d36574daa 100644
--- a/gm/factory.cpp
+++ b/gm/factory.cpp
@@ -36,7 +36,8 @@ protected:
// bitmap is unlocked.
SkAutoTUnref<SkDiscardableMemoryPool> pool(
SkDiscardableMemoryPool::Create(1));
- SkAssertResult(SkInstallDiscardablePixelRef(SkImageGenerator::NewFromEncoded(data),
+ SkAssertResult(SkDEPRECATED_InstallDiscardablePixelRef(
+ SkImageGenerator::NewFromEncoded(data),
nullptr, &fBitmap, pool));
}
}
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h
index b91aa653a5..0e2a45e145 100644
--- a/include/core/SkImageGenerator.h
+++ b/include/core/SkImageGenerator.h
@@ -39,13 +39,13 @@ class SkPicture;
*
* @return true iff successful.
*/
-SK_API bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destination);
+SK_API bool SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destination);
/**
* On success, installs a discardable pixelref into destination, based on encoded data.
* Regardless of success or failure, the caller must still balance their ownership of encoded.
*/
-SK_API bool SkInstallDiscardablePixelRef(SkData* encoded, SkBitmap* destination);
+SK_API bool SkDEPRECATED_InstallDiscardablePixelRef(SkData* encoded, SkBitmap* destination);
/**
* An interface that allows a purgeable PixelRef (such as a
diff --git a/src/core/SkImageGeneratorPriv.h b/src/core/SkImageGeneratorPriv.h
index bf035967a2..93114e328f 100644
--- a/src/core/SkImageGeneratorPriv.h
+++ b/src/core/SkImageGeneratorPriv.h
@@ -33,7 +33,8 @@
*
* @return true iff successful.
*/
-bool SkInstallDiscardablePixelRef(SkImageGenerator*, const SkIRect* subset, SkBitmap* destination,
- SkDiscardableMemory::Factory* factory);
+bool SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator*, const SkIRect* subset,
+ SkBitmap* destination,
+ SkDiscardableMemory::Factory* factory);
#endif
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index 80d5974b05..906313d819 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -219,7 +219,7 @@ SkShader* SkPictureShader::refBitmapShader(const SkMatrix& viewMatrix, const SkM
tileMatrix.setRectToRect(fTile, SkRect::MakeIWH(tileSize.width(), tileSize.height()),
SkMatrix::kFill_ScaleToFit);
SkBitmap bm;
- if (!SkInstallDiscardablePixelRef(
+ if (!SkDEPRECATED_InstallDiscardablePixelRef(
SkImageGenerator::NewFromPicture(tileSize, fPicture, &tileMatrix, nullptr), &bm)) {
return nullptr;
}
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index 9ac9819e92..0cb0e02c27 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -101,8 +101,8 @@ void SkDiscardablePixelRef::onUnlockPixels() {
fDiscardableMemoryIsLocked = false;
}
-bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, const SkIRect* subset, SkBitmap* dst,
- SkDiscardableMemory::Factory* factory) {
+bool SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator* generator, const SkIRect* subset,
+ SkBitmap* dst, SkDiscardableMemory::Factory* factory) {
SkAutoTDelete<SkImageGenerator> autoGenerator(generator);
if (nullptr == autoGenerator.get()) {
return false;
@@ -144,11 +144,12 @@ bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, const SkIRect* su
// These are the public API
-bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst) {
- return SkInstallDiscardablePixelRef(generator, nullptr, dst, nullptr);
+bool SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst) {
+ return SkDEPRECATED_InstallDiscardablePixelRef(generator, nullptr, dst, nullptr);
}
-bool SkInstallDiscardablePixelRef(SkData* encoded, SkBitmap* dst) {
+bool SkDEPRECATED_InstallDiscardablePixelRef(SkData* encoded, SkBitmap* dst) {
SkImageGenerator* generator = SkImageGenerator::NewFromEncoded(encoded);
- return generator ? SkInstallDiscardablePixelRef(generator, nullptr, dst, nullptr) : false;
+ return generator ?
+ SkDEPRECATED_InstallDiscardablePixelRef(generator, nullptr, dst, nullptr) : false;
}
diff --git a/src/lazy/SkDiscardablePixelRef.h b/src/lazy/SkDiscardablePixelRef.h
index 3b38fa669c..695d441d2b 100644
--- a/src/lazy/SkDiscardablePixelRef.h
+++ b/src/lazy/SkDiscardablePixelRef.h
@@ -66,7 +66,7 @@ private:
return fGenerator->getYUV8Planes(sizes, planes, rowBytes, colorSpace);
}
- friend bool SkInstallDiscardablePixelRef(SkImageGenerator*, const SkIRect*, SkBitmap*,
+ friend bool SkDEPRECATED_InstallDiscardablePixelRef(SkImageGenerator*, const SkIRect*, SkBitmap*,
SkDiscardableMemory::Factory*);
typedef SkPixelRef INHERITED;
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index 136b2f584a..2813b42bf8 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -142,7 +142,7 @@ static void test_three_encodings(skiatest::Reporter* reporter,
////////////////////////////////////////////////////////////////////////////////
static bool install_skDiscardablePixelRef(SkData* encoded, SkBitmap* dst) {
// Use system-default discardable memory.
- return SkInstallDiscardablePixelRef(encoded, dst);
+ return SkDEPRECATED_InstallDiscardablePixelRef(encoded, dst);
}
////////////////////////////////////////////////////////////////////////////////
@@ -228,7 +228,7 @@ static void check_pixelref(TestImageGenerator::TestType type,
SkAutoTDelete<SkImageGenerator> gen(new TestImageGenerator(type, reporter));
REPORTER_ASSERT(reporter, gen.get() != nullptr);
SkBitmap lazy;
- bool success = SkInstallDiscardablePixelRef(gen.detach(), nullptr, &lazy, factory);
+ bool success = SkDEPRECATED_InstallDiscardablePixelRef(gen.detach(), nullptr, &lazy, factory);
REPORTER_ASSERT(reporter, success);
if (TestImageGenerator::kSucceedGetPixels_TestType == type) {
diff --git a/tests/KtxTest.cpp b/tests/KtxTest.cpp
index 4315e6dbd6..e0d9a27b40 100644
--- a/tests/KtxTest.cpp
+++ b/tests/KtxTest.cpp
@@ -150,7 +150,7 @@ DEF_TEST(KtxReexportPKM, reporter) {
}
bool installDiscardablePixelRefSuccess =
- SkInstallDiscardablePixelRef(fileData, &etcBitmap);
+ SkDEPRECATED_InstallDiscardablePixelRef(fileData, &etcBitmap);
REPORTER_ASSERT(reporter, installDiscardablePixelRefSuccess);
// Write the bitmap out to a KTX file.
diff --git a/tests/PDFJpegEmbedTest.cpp b/tests/PDFJpegEmbedTest.cpp
index 530ed2a1d0..812fd3b2c3 100644
--- a/tests/PDFJpegEmbedTest.cpp
+++ b/tests/PDFJpegEmbedTest.cpp
@@ -18,7 +18,7 @@
static SkBitmap bitmap_from_data(SkData* data) {
SkASSERT(data);
SkBitmap bm;
- SkInstallDiscardablePixelRef(data, &bm);
+ SkDEPRECATED_InstallDiscardablePixelRef(data, &bm);
return bm;
}
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 45edc715ef..dee24e367e 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -887,7 +887,7 @@ static void test_bitmap_with_encoded_data(skiatest::Reporter* reporter) {
SkAutoDataUnref data(wStream.copyToData());
SkBitmap bm;
- bool installSuccess = SkInstallDiscardablePixelRef(data, &bm);
+ bool installSuccess = SkDEPRECATED_InstallDiscardablePixelRef(data, &bm);
REPORTER_ASSERT(reporter, installSuccess);
// Write both bitmaps to pictures, and ensure that the resulting data streams are the same.
diff --git a/tools/LazyDecodeBitmap.cpp b/tools/LazyDecodeBitmap.cpp
index b6ac2d5566..d41889b861 100644
--- a/tools/LazyDecodeBitmap.cpp
+++ b/tools/LazyDecodeBitmap.cpp
@@ -40,5 +40,5 @@ bool sk_tools::LazyDecodeBitmap(const void* src, size_t length, SkBitmap* dst) {
// Only meaningful if platform has a default discardable
// memory implementation that differs from the global DM pool.
}
- return SkInstallDiscardablePixelRef(gen.detach(), nullptr, dst, pool);
+ return SkDEPRECATED_InstallDiscardablePixelRef(gen.detach(), nullptr, dst, pool);
}
diff --git a/tools/flatten.cpp b/tools/flatten.cpp
index 80579df48f..8ba20929fb 100644
--- a/tools/flatten.cpp
+++ b/tools/flatten.cpp
@@ -21,7 +21,7 @@ __SK_FORCE_IMAGE_DECODER_LINKING;
static bool lazy_decode_bitmap(const void* src, size_t size, SkBitmap* dst) {
SkAutoTUnref<SkData> encoded(SkData::NewWithCopy(src, size));
- return encoded && SkInstallDiscardablePixelRef(encoded, dst);
+ return encoded && SkDEPRECATED_InstallDiscardablePixelRef(encoded, dst);
}
int main(int argc, char** argv) {