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

Side by Side Diff: src/core/SkBitmapHeap.h

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, 5 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 unified diff | Download patch
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkCachedData.h » ('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 2012 Google Inc. 3 * Copyright 2012 Google Inc.
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 #ifndef SkBitmapHeap_DEFINED 8 #ifndef SkBitmapHeap_DEFINED
9 #define SkBitmapHeap_DEFINED 9 #define SkBitmapHeap_DEFINED
10 10
11 #include "SkBitmap.h" 11 #include "SkBitmap.h"
12 #include "SkFlattenable.h" 12 #include "SkFlattenable.h"
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 #include "SkTDArray.h" 14 #include "SkTDArray.h"
15 #include "SkAtomics.h" 15 #include "SkThread.h"
16 16
17 /** 17 /**
18 * SkBitmapHeapEntry provides users of SkBitmapHeap (using internal storage) wit h a means to... 18 * SkBitmapHeapEntry provides users of SkBitmapHeap (using internal storage) wit h a means to...
19 * (1) get access a bitmap in the heap 19 * (1) get access a bitmap in the heap
20 * (2) indicate they are done with bitmap by releasing their reference (if they were an owner). 20 * (2) indicate they are done with bitmap by releasing their reference (if they were an owner).
21 */ 21 */
22 class SkBitmapHeapEntry : SkNoncopyable { 22 class SkBitmapHeapEntry : SkNoncopyable {
23 public: 23 public:
24 ~SkBitmapHeapEntry(); 24 ~SkBitmapHeapEntry();
25 25
(...skipping 19 matching lines...) Expand all
45 // reclaimed. 45 // reclaimed.
46 size_t fBytesAllocated; 46 size_t fBytesAllocated;
47 47
48 friend class SkBitmapHeap; 48 friend class SkBitmapHeap;
49 friend class SkBitmapHeapTester; 49 friend class SkBitmapHeapTester;
50 }; 50 };
51 51
52 52
53 class SkBitmapHeapReader : public SkRefCnt { 53 class SkBitmapHeapReader : public SkRefCnt {
54 public: 54 public:
55 55
56 56
57 SkBitmapHeapReader() : INHERITED() {} 57 SkBitmapHeapReader() : INHERITED() {}
58 virtual SkBitmap* getBitmap(int32_t slot) const = 0; 58 virtual SkBitmap* getBitmap(int32_t slot) const = 0;
59 virtual void releaseRef(int32_t slot) = 0; 59 virtual void releaseRef(int32_t slot) = 0;
60 private: 60 private:
61 typedef SkRefCnt INHERITED; 61 typedef SkRefCnt INHERITED;
62 }; 62 };
63 63
64 64
65 /** 65 /**
66 * TODO: stores immutable bitmaps into a heap 66 * TODO: stores immutable bitmaps into a heap
67 */ 67 */
68 class SkBitmapHeap : public SkBitmapHeapReader { 68 class SkBitmapHeap : public SkBitmapHeapReader {
69 public: 69 public:
70 class ExternalStorage : public SkRefCnt { 70 class ExternalStorage : public SkRefCnt {
71 public: 71 public:
72 72
73 73
74 virtual bool insert(const SkBitmap& bitmap, int32_t slot) = 0; 74 virtual bool insert(const SkBitmap& bitmap, int32_t slot) = 0;
75 75
76 private: 76 private:
77 typedef SkRefCnt INHERITED; 77 typedef SkRefCnt INHERITED;
78 }; 78 };
79 79
80 static const int32_t UNLIMITED_SIZE = -1; 80 static const int32_t UNLIMITED_SIZE = -1;
81 static const int32_t IGNORE_OWNERS = -1; 81 static const int32_t IGNORE_OWNERS = -1;
82 static const int32_t INVALID_SLOT = -1; 82 static const int32_t INVALID_SLOT = -1;
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 const int32_t fOwnerCount; 289 const int32_t fOwnerCount;
290 size_t fBytesAllocated; 290 size_t fBytesAllocated;
291 291
292 bool fDeferAddingOwners; 292 bool fDeferAddingOwners;
293 SkTDArray<int> fDeferredEntries; 293 SkTDArray<int> fDeferredEntries;
294 294
295 typedef SkBitmapHeapReader INHERITED; 295 typedef SkBitmapHeapReader INHERITED;
296 }; 296 };
297 297
298 #endif // SkBitmapHeap_DEFINED 298 #endif // SkBitmapHeap_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/core/SkCachedData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698