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

Unified Diff: src/core/SkResourceCache.cpp

Issue 1214603003: Revert of Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkRegionPriv.h ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkResourceCache.cpp
diff --git a/src/core/SkResourceCache.cpp b/src/core/SkResourceCache.cpp
index 6c76d350c39bda864dae139838924d2f1d92fe16..f0fe72113ed42dad67c509b71802b1d864215175 100644
--- a/src/core/SkResourceCache.cpp
+++ b/src/core/SkResourceCache.cpp
@@ -8,7 +8,6 @@
#include "SkChecksum.h"
#include "SkMessageBus.h"
#include "SkMipMap.h"
-#include "SkMutex.h"
#include "SkPixelRef.h"
#include "SkResourceCache.h"
@@ -75,7 +74,7 @@
class SkOneShotDiscardablePixelRef : public SkPixelRef {
public:
-
+
// Ownership of the discardablememory is transfered to the pixelref
SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_t rowBytes);
~SkOneShotDiscardablePixelRef();
@@ -237,7 +236,7 @@
void SkResourceCache::add(Rec* rec) {
this->checkMessages();
-
+
SkASSERT(rec);
// See if we already have this key (racy inserts, etc.)
Rec* existing = fHash->find(rec->getKey());
@@ -245,7 +244,7 @@
SkDELETE(rec);
return;
}
-
+
this->addToHead(rec);
fHash->add(rec);
@@ -358,7 +357,7 @@
SkCachedData* SkResourceCache::newCachedData(size_t bytes) {
this->checkMessages();
-
+
if (fDiscardableFactory) {
SkDiscardableMemory* dm = fDiscardableFactory(bytes);
return dm ? SkNEW_ARGS(SkCachedData, (bytes, dm)) : NULL;
@@ -515,6 +514,8 @@
}
///////////////////////////////////////////////////////////////////////////////
+
+#include "SkThread.h"
SK_DECLARE_STATIC_MUTEX(gMutex);
static SkResourceCache* gResourceCache = NULL;
« no previous file with comments | « src/core/SkRegionPriv.h ('k') | src/core/SkScalerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698