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

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

Issue 101913006: Mac 10.6 compiler fix for r12665 (Closed) Base URL: http://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 | « no previous file | no next file » | 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 "SkDiscardablePixelRef.h" 8 #include "SkDiscardablePixelRef.h"
9 #include "SkDiscardableMemory.h" 9 #include "SkDiscardableMemory.h"
10 #include "SkImageGenerator.h" 10 #include "SkImageGenerator.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 } 56 }
57 if (NULL == fDiscardableMemory) { 57 if (NULL == fDiscardableMemory) {
58 return false; // Memory allocation failed. 58 return false; // Memory allocation failed.
59 } 59 }
60 60
61 void* pixels = fDiscardableMemory->data(); 61 void* pixels = fDiscardableMemory->data();
62 if (!fGenerator->getPixels(this->info(), pixels, fRowBytes)) { 62 if (!fGenerator->getPixels(this->info(), pixels, fRowBytes)) {
63 fDiscardableMemory->unlock(); 63 fDiscardableMemory->unlock();
64 SkDELETE(fDiscardableMemory); 64 SkDELETE(fDiscardableMemory);
65 fDiscardableMemory = NULL; 65 fDiscardableMemory = NULL;
66 return NULL; 66 return false;
67 } 67 }
68 68
69 rec->fPixels = pixels; 69 rec->fPixels = pixels;
70 rec->fColorTable = NULL; 70 rec->fColorTable = NULL;
71 rec->fRowBytes = fRowBytes; 71 rec->fRowBytes = fRowBytes;
72 return true; 72 return true;
73 } 73 }
74 74
75 void SkDiscardablePixelRef::onUnlockPixels() { 75 void SkDiscardablePixelRef::onUnlockPixels() {
76 fDiscardableMemory->unlock(); 76 fDiscardableMemory->unlock();
(...skipping 15 matching lines...) Expand all
92 SkDELETE(generator); // Do not need this anymore. 92 SkDELETE(generator); // Do not need this anymore.
93 return dst->allocPixels(NULL, NULL); 93 return dst->allocPixels(NULL, NULL);
94 } 94 }
95 SkAutoTUnref<SkDiscardablePixelRef> ref(SkNEW_ARGS(SkDiscardablePixelRef, 95 SkAutoTUnref<SkDiscardablePixelRef> ref(SkNEW_ARGS(SkDiscardablePixelRef,
96 (generator, info, 96 (generator, info,
97 dst->rowBytes(), 97 dst->rowBytes(),
98 factory))); 98 factory)));
99 dst->setPixelRef(ref); 99 dst->setPixelRef(ref);
100 return true; 100 return true;
101 } 101 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698