use SkStream factory for files, and check for null (file-not-found) speedup sampleapp's animation
BUG= Review URL: https://codereview.chromium.org/16173003 git-svn-id: http://skia.googlecode.com/svn/trunk@9327 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
ed8d6bb2be
commit
84cfce14fe
@ -74,7 +74,7 @@ SkTCPServer gServer;
|
||||
#endif
|
||||
|
||||
#define ANIMATING_EVENTTYPE "nextSample"
|
||||
#define ANIMATING_DELAY 750
|
||||
#define ANIMATING_DELAY 250
|
||||
|
||||
#ifdef SK_DEBUG
|
||||
#define FPS_REPEAT_MULTIPLIER 1
|
||||
|
@ -33,14 +33,16 @@
|
||||
#include "SkImageRef_GlobalPool.h"
|
||||
|
||||
static SkBitmap load_bitmap() {
|
||||
SkStream* stream = new SkFILEStream("/skimages/sesame_street_ensemble-hp.jpg");
|
||||
SkAutoUnref aur(stream);
|
||||
|
||||
SkBitmap bm;
|
||||
if (SkImageDecoder::DecodeStream(stream, &bm, SkBitmap::kNo_Config,
|
||||
SkImageDecoder::kDecodeBounds_Mode)) {
|
||||
SkPixelRef* pr = new SkImageRef_GlobalPool(stream, bm.config(), 1);
|
||||
bm.setPixelRef(pr)->unref();
|
||||
SkStream* stream = SkStream::NewFromFile("/skimages/sesame_street_ensemble-hp.jpg");
|
||||
if (stream) {
|
||||
SkAutoUnref aur(stream);
|
||||
|
||||
if (SkImageDecoder::DecodeStream(stream, &bm, SkBitmap::kNo_Config,
|
||||
SkImageDecoder::kDecodeBounds_Mode)) {
|
||||
SkPixelRef* pr = new SkImageRef_GlobalPool(stream, bm.config(), 1);
|
||||
bm.setPixelRef(pr)->unref();
|
||||
}
|
||||
}
|
||||
return bm;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user