am f79bcd2d: am 52da99fa: am a081c7b8: Merge "Skia API changes as a result of an update to the Skia library."

* commit 'f79bcd2dd5d82376640661f50aa2e9237af7c02c':
  Skia API changes as a result of an update to the Skia library.
This commit is contained in:
Jean-Baptiste Queru
2012-02-06 14:12:05 -08:00
committed by Android Git Automerger
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) {