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: src/lazy/SkCachingPixelRef.cpp

Issue 103753007: Revert of Change SkDecodingImageGenerator API (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
« 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);
15 SkASSERT(dst != NULL); 16 SkASSERT(dst != NULL);
16 if ((NULL == generator) 17 if ((NULL == generator)
17 || !(generator->getInfo(&info)) 18 || !(generator->getInfo(&info))
18 || !dst->setConfig(info, 0)) { 19 || !dst->setConfig(info, 0)) {
19 SkDELETE(generator); 20 SkDELETE(generator);
20 return false; 21 return false;
21 } 22 }
22 SkAutoTUnref<SkCachingPixelRef> ref(SkNEW_ARGS(SkCachingPixelRef, 23 SkAutoTUnref<SkCachingPixelRef> ref(SkNEW_ARGS(SkCachingPixelRef,
23 (info, generator, dst->rowBytes()))); 24 (info, generator, dst->rowBytes())));
24 dst->setPixelRef(ref); 25 dst->setPixelRef(ref);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // reference to the concrete PixelRef while this record is 86 // reference to the concrete PixelRef while this record is
86 // locked. 87 // locked.
87 return pixels; 88 return pixels;
88 } 89 }
89 90
90 void SkCachingPixelRef::onUnlockPixels() { 91 void SkCachingPixelRef::onUnlockPixels() {
91 SkASSERT(fScaledCacheId != NULL); 92 SkASSERT(fScaledCacheId != NULL);
92 SkScaledImageCache::Unlock( static_cast<SkScaledImageCache::ID*>(fScaledCach eId)); 93 SkScaledImageCache::Unlock( static_cast<SkScaledImageCache::ID*>(fScaledCach eId));
93 fScaledCacheId = NULL; 94 fScaledCacheId = NULL;
94 } 95 }
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