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

Unified Diff: src/core/SkBitmap.cpp

Issue 769323002: Make SkColorTable explicitly thread-safe. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkBitmap.cpp
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index d644ecb12595400777b1479c59b68c88277614d3..c1add1fed95e8c21d3bf1da63cce9ea6d8a6c547 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -938,8 +938,7 @@ bool SkBitmap::copyTo(SkBitmap* dst, SkColorType dstColorType, Allocator* alloc)
// allocate colortable if srcConfig == kIndex8_Config
SkAutoTUnref<SkColorTable> ctable;
if (dstColorType == kIndex_8_SkColorType) {
- // TODO: can we just ref() the src colortable? Is it reentrant-safe?
- ctable.reset(SkNEW_ARGS(SkColorTable, (*src->getColorTable())));
+ ctable.reset(SkRef(src->getColorTable()));
}
if (!tmpDst.tryAllocPixels(alloc, ctable)) {
return false;

Powered by Google App Engine
This is Rietveld 408576698