Skia API changes as a result of an update to the Skia library.

These changes are required to work with r3022 of Skia

Change-Id: Ib7cebeb2eba6790bb38edfc2397b311cf419e17c
This commit is contained in:
Derek Sollenberger
2012-01-31 14:08:22 -05:00
parent 9781870491
commit 889a3fa6ab
2 changed files with 5 additions and 2 deletions

View File

@@ -28,6 +28,7 @@
#include <SkImageEncoder.h>
#include <SkBitmap.h>
#include <SkData.h>
#include <SkStream.h>
using namespace android;
@@ -168,7 +169,9 @@ int main(int argc, char** argv)
SkDynamicMemoryWStream stream;
SkImageEncoder::EncodeStream(&stream, b,
SkImageEncoder::kPNG_Type, SkImageEncoder::kDefaultQuality);
write(fd, stream.getStream(), stream.getOffset());
SkData* streamData = stream.copyToData();
write(fd, streamData->data(), streamData->size());
streamData->unref();
} else {
write(fd, &w, 4);
write(fd, &h, 4);

View File

@@ -67,7 +67,7 @@ public:
static void freeCaches(JNIEnv* env, jobject) {
// these are called in no particular order
SkImageRef_GlobalPool::SetRAMUsed(0);
SkGraphics::SetFontCacheUsed(0);
SkGraphics::PurgeFontCache();
}
static jboolean isOpaque(JNIEnv* env, jobject jcanvas) {