Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: tools/LazyDecodeBitmap.cpp

Issue 111713002: Sk_API for SkImageGenerator and SkInstallDiscardablePixelRef (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "LazyDecodeBitmap.h" 8 #include "LazyDecodeBitmap.h"
9 9
10 #include "SkData.h" 10 #include "SkData.h"
11 #include "SkDecodingImageGenerator.h" 11 #include "SkDecodingImageGenerator.h"
12 #include "SkDiscardableMemoryPool.h" 12 #include "SkDiscardableMemoryPool.h"
13 #include "SkDiscardablePixelRef.h" 13 #include "SkImageGenerator.h"
14 #include "SkForceLinking.h" 14 #include "SkForceLinking.h"
15 15
16 #include "SkCommandLineFlags.h" 16 #include "SkCommandLineFlags.h"
17 17
18 __SK_FORCE_IMAGE_DECODER_LINKING; 18 __SK_FORCE_IMAGE_DECODER_LINKING;
19 19
20 // TODO(halcanary) Use this flag when ashmem-backed discardable memory lands. 20 // TODO(halcanary) Use this flag when ashmem-backed discardable memory lands.
21 DEFINE_bool(useVolatileCache, false, "Use a volatile cache for deferred image de coding pixels. " 21 DEFINE_bool(useVolatileCache, false, "Use a volatile cache for deferred image de coding pixels. "
22 "Only meaningful if --deferImageDecoding is set to true and the plat form has an " 22 "Only meaningful if --deferImageDecoding is set to true and the plat form has an "
23 "implementation."); 23 "implementation.");
(...skipping 12 matching lines...) Expand all
36 (data))); 36 (data)));
37 SkImageInfo info; 37 SkImageInfo info;
38 if (!gen->getInfo(&info)) { 38 if (!gen->getInfo(&info)) {
39 return false; 39 return false;
40 } 40 }
41 SkDiscardableMemory::Factory* pool = NULL; 41 SkDiscardableMemory::Factory* pool = NULL;
42 if (info.fWidth * info.fHeight > 32 * 1024) { 42 if (info.fWidth * info.fHeight > 32 * 1024) {
43 // how to do switching with SkDiscardableMemory. 43 // how to do switching with SkDiscardableMemory.
44 pool = SkGetGlobalDiscardableMemoryPool(); 44 pool = SkGetGlobalDiscardableMemoryPool();
45 } 45 }
46 return SkDiscardablePixelRef::Install(gen.detach(), dst, pool); 46 return SkInstallDiscardablePixelRef(gen.detach(), dst, pool);
47 } 47 }
OLDNEW
« src/lazy/SkDiscardablePixelRef.cpp ('K') | « tests/DrawBitmapRectTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698