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

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

Issue 750583002: Revert of Add MultiPictureDraw to nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/SkBitmap.cpp ('k') | 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 /* 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 *dst++ = SkPixel32ToPixel16_ToU16(*src++); 63 *dst++ = SkPixel32ToPixel16_ToU16(*src++);
64 } 64 }
65 } 65 }
66 66
67 const uint16_t* SkColorTable::lock16BitCache() { 67 const uint16_t* SkColorTable::lock16BitCache() {
68 if (NULL == f16BitCache) { 68 if (NULL == f16BitCache) {
69 f16BitCache = (uint16_t*)sk_malloc_throw(fCount * sizeof(uint16_t)); 69 f16BitCache = (uint16_t*)sk_malloc_throw(fCount * sizeof(uint16_t));
70 build_16bitcache(f16BitCache, fColors, fCount); 70 build_16bitcache(f16BitCache, fColors, fCount);
71 } 71 }
72 72
73 SkDEBUGCODE(sk_atomic_inc(&f16BitCacheLockCount)); 73 SkDEBUGCODE(f16BitCacheLockCount += 1);
74 return f16BitCache; 74 return f16BitCache;
75 } 75 }
76 76
77 /////////////////////////////////////////////////////////////////////////////// 77 ///////////////////////////////////////////////////////////////////////////////
78 78
79 SkColorTable::SkColorTable(SkReadBuffer& buffer) { 79 SkColorTable::SkColorTable(SkReadBuffer& buffer) {
80 f16BitCache = NULL; 80 f16BitCache = NULL;
81 SkDEBUGCODE(fColorLockCount = 0;) 81 SkDEBUGCODE(fColorLockCount = 0;)
82 SkDEBUGCODE(f16BitCacheLockCount = 0;) 82 SkDEBUGCODE(f16BitCacheLockCount = 0;)
83 83
(...skipping 13 matching lines...) Expand all
97 } 97 }
98 #ifdef SK_DEBUG 98 #ifdef SK_DEBUG
99 SkASSERT((unsigned)fCount <= 256); 99 SkASSERT((unsigned)fCount <= 256);
100 SkASSERT(success); 100 SkASSERT(success);
101 #endif 101 #endif
102 } 102 }
103 103
104 void SkColorTable::writeToBuffer(SkWriteBuffer& buffer) const { 104 void SkColorTable::writeToBuffer(SkWriteBuffer& buffer) const {
105 buffer.writeColorArray(fColors, fCount); 105 buffer.writeColorArray(fColors, fCount);
106 } 106 }
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698