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

Side by Side Diff: src/lazy/SkCachingPixelRef.cpp

Issue 93703004: Change SkDecodingImageGenerator API (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebased Created 6 years, 11 months 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
« no previous file with comments | « src/images/SkDecodingImageGenerator.cpp ('k') | src/lazy/SkDiscardablePixelRef.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkCachingPixelRef.h" 8 #include "SkCachingPixelRef.h"
9 #include "SkScaledImageCache.h" 9 #include "SkScaledImageCache.h"
10 10
11 11
12 bool SkCachingPixelRef::Install(SkImageGenerator* generator, 12 bool SkCachingPixelRef::Install(SkImageGenerator* generator,
13 SkBitmap* dst) { 13 SkBitmap* dst) {
14 SkImageInfo info; 14 SkImageInfo info;
15 SkASSERT(generator != NULL);
16 SkASSERT(dst != NULL); 15 SkASSERT(dst != NULL);
17 if ((NULL == generator) 16 if ((NULL == generator)
18 || !(generator->getInfo(&info)) 17 || !(generator->getInfo(&info))
19 || !dst->setConfig(info, 0)) { 18 || !dst->setConfig(info, 0)) {
20 SkDELETE(generator); 19 SkDELETE(generator);
21 return false; 20 return false;
22 } 21 }
23 SkAutoTUnref<SkCachingPixelRef> ref(SkNEW_ARGS(SkCachingPixelRef, 22 SkAutoTUnref<SkCachingPixelRef> ref(SkNEW_ARGS(SkCachingPixelRef,
24 (info, generator, dst->rowBytes()))); 23 (info, generator, dst->rowBytes())));
25 dst->setPixelRef(ref); 24 dst->setPixelRef(ref);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // reference to the concrete PixelRef while this record is 85 // reference to the concrete PixelRef while this record is
87 // locked. 86 // locked.
88 return pixels; 87 return pixels;
89 } 88 }
90 89
91 void SkCachingPixelRef::onUnlockPixels() { 90 void SkCachingPixelRef::onUnlockPixels() {
92 SkASSERT(fScaledCacheId != NULL); 91 SkASSERT(fScaledCacheId != NULL);
93 SkScaledImageCache::Unlock( static_cast<SkScaledImageCache::ID*>(fScaledCach eId)); 92 SkScaledImageCache::Unlock( static_cast<SkScaledImageCache::ID*>(fScaledCach eId));
94 fScaledCacheId = NULL; 93 fScaledCacheId = NULL;
95 } 94 }
OLDNEW
« no previous file with comments | « src/images/SkDecodingImageGenerator.cpp ('k') | src/lazy/SkDiscardablePixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698