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

Unified Diff: src/core/SkResourceCache.cpp

Issue 1215393002: Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: skimagefilter 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 f0fe72113ed42dad67c509b71802b1d864215175..6c76d350c39bda864dae139838924d2f1d92fe16 100644
--- a/src/core/SkResourceCache.cpp
+++ b/src/core/SkResourceCache.cpp
@@ -8,6 +8,7 @@
#include "SkChecksum.h"
#include "SkMessageBus.h"
#include "SkMipMap.h"
+#include "SkMutex.h"
#include "SkPixelRef.h"
#include "SkResourceCache.h"
@@ -74,7 +75,7 @@ void SkResourceCache::init() {
class SkOneShotDiscardablePixelRef : public SkPixelRef {
public:
-
+
// Ownership of the discardablememory is transfered to the pixelref
SkOneShotDiscardablePixelRef(const SkImageInfo&, SkDiscardableMemory*, size_t rowBytes);
~SkOneShotDiscardablePixelRef();
@@ -236,7 +237,7 @@ static bool gDumpCacheTransactions;
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());
@@ -244,7 +245,7 @@ void SkResourceCache::add(Rec* rec) {
SkDELETE(rec);
return;
}
-
+
this->addToHead(rec);
fHash->add(rec);
@@ -357,7 +358,7 @@ size_t SkResourceCache::setTotalByteLimit(size_t newLimit) {
SkCachedData* SkResourceCache::newCachedData(size_t bytes) {
this->checkMessages();
-
+
if (fDiscardableFactory) {
SkDiscardableMemory* dm = fDiscardableFactory(bytes);
return dm ? SkNEW_ARGS(SkCachedData, (bytes, dm)) : NULL;
@@ -515,8 +516,6 @@ void SkResourceCache::checkMessages() {
///////////////////////////////////////////////////////////////////////////////
-#include "SkThread.h"
-
SK_DECLARE_STATIC_MUTEX(gMutex);
static SkResourceCache* gResourceCache = NULL;
static void cleanup_gResourceCache() {
« 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