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

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

Issue 98703002: Fix compilation with SK_ENABLE_INST_COUNT=1 (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/core/SkColorFilter.cpp ('k') | src/core/SkData.cpp » ('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"
11 #include "SkFlattenableBuffers.h" 11 #include "SkFlattenableBuffers.h"
12 #include "SkStream.h" 12 #include "SkStream.h"
13 #include "SkTemplates.h" 13 #include "SkTemplates.h"
14 14
15 SK_DEFINE_INST_COUNT(SkColorTable)
16
17 // As copy constructor is hidden in the class hierarchy, we need to call 15 // As copy constructor is hidden in the class hierarchy, we need to call
18 // default constructor explicitly to suppress a compiler warning. 16 // default constructor explicitly to suppress a compiler warning.
19 SkColorTable::SkColorTable(const SkColorTable& src) : INHERITED() { 17 SkColorTable::SkColorTable(const SkColorTable& src) : INHERITED() {
20 f16BitCache = NULL; 18 f16BitCache = NULL;
21 fAlphaType = src.fAlphaType; 19 fAlphaType = src.fAlphaType;
22 int count = src.count(); 20 int count = src.count();
23 fCount = SkToU16(count); 21 fCount = SkToU16(count);
24 fColors = reinterpret_cast<SkPMColor*>( 22 fColors = reinterpret_cast<SkPMColor*>(
25 sk_malloc_throw(count * sizeof(SkPMColor))); 23 sk_malloc_throw(count * sizeof(SkPMColor)));
26 memcpy(fColors, src.fColors, count * sizeof(SkPMColor)); 24 memcpy(fColors, src.fColors, count * sizeof(SkPMColor));
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 #ifdef SK_DEBUG 95 #ifdef SK_DEBUG
98 SkASSERT((unsigned)fCount <= 256); 96 SkASSERT((unsigned)fCount <= 256);
99 SkASSERT(success); 97 SkASSERT(success);
100 #endif 98 #endif
101 } 99 }
102 100
103 void SkColorTable::writeToBuffer(SkFlattenableWriteBuffer& buffer) const { 101 void SkColorTable::writeToBuffer(SkFlattenableWriteBuffer& buffer) const {
104 buffer.writeUInt(fAlphaType); 102 buffer.writeUInt(fAlphaType);
105 buffer.writeColorArray(fColors, fCount); 103 buffer.writeColorArray(fColors, fCount);
106 } 104 }
OLDNEW
« no previous file with comments | « src/core/SkColorFilter.cpp ('k') | src/core/SkData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698