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

Side by Side Diff: src/core/SkColorTable.cpp

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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
« no previous file with comments | « src/core/SkAdvancedTypefaceMetrics.cpp ('k') | src/core/SkFontDescriptor.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 /* 2 /*
3 * Copyright 2009 The Android Open Source Project 3 * Copyright 2009 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkColorTable.h" 10 #include "SkColorTable.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 buffer.validate(false); 100 buffer.validate(false);
101 return nullptr; 101 return nullptr;
102 } 102 }
103 103
104 const size_t allocSize = count * sizeof(SkPMColor); 104 const size_t allocSize = count * sizeof(SkPMColor);
105 SkAutoTDelete<SkPMColor> colors((SkPMColor*)sk_malloc_throw(allocSize)); 105 SkAutoTDelete<SkPMColor> colors((SkPMColor*)sk_malloc_throw(allocSize));
106 if (!buffer.readColorArray(colors, count)) { 106 if (!buffer.readColorArray(colors, count)) {
107 return nullptr; 107 return nullptr;
108 } 108 }
109 109
110 return new SkColorTable(colors.detach(), count, kAllocatedWithMalloc); 110 return new SkColorTable(colors.release(), count, kAllocatedWithMalloc);
111 } 111 }
112 112
OLDNEW
« no previous file with comments | « src/core/SkAdvancedTypefaceMetrics.cpp ('k') | src/core/SkFontDescriptor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698