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

Unified Diff: src/core/SkRecord.h

Issue 1300163002: unsigned -> int for counts and indices in picture-related code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 5 years, 4 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/SkRTree.cpp ('k') | src/core/SkRecord.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecord.h
diff --git a/src/core/SkRecord.h b/src/core/SkRecord.h
index 0fe316ee78728a8a6885c5250957d264d4150b3c..9672bbcffa4711a89ef40b2408989e5cd3570d07 100644
--- a/src/core/SkRecord.h
+++ b/src/core/SkRecord.h
@@ -40,14 +40,14 @@ public:
~SkRecord();
// Returns the number of canvas commands in this SkRecord.
- unsigned count() const { return fCount; }
+ int count() const { return fCount; }
// Visit the i-th canvas command with a functor matching this interface:
// template <typename T>
// R operator()(const T& record) { ... }
// This operator() must be defined for at least all SkRecords::*.
template <typename R, typename F>
- R visit(unsigned i, F& f) const {
+ R visit(int i, F& f) const {
SkASSERT(i < this->count());
return fRecords[i].visit<R>(f);
}
@@ -57,7 +57,7 @@ public:
// R operator()(T* record) { ... }
// This operator() must be defined for at least all SkRecords::*.
template <typename R, typename F>
- R mutate(unsigned i, F& f) {
+ R mutate(int i, F& f) {
SkASSERT(i < this->count());
return fRecords[i].mutate<R>(f);
}
@@ -85,7 +85,7 @@ public:
// You are expected to placement new an object of type T onto this pointer.
// References to the original command are invalidated.
template <typename T>
- T* replace(unsigned i) {
+ T* replace(int i) {
SkASSERT(i < this->count());
Destroyer destroyer;
@@ -98,7 +98,7 @@ public:
// You are expected to placement new an object of type T onto this pointer.
// You must show proof that you've already adopted the existing command.
template <typename T, typename Existing>
- T* replace(unsigned i, const SkRecords::Adopted<Existing>& proofOfAdoption) {
+ T* replace(int i, const SkRecords::Adopted<Existing>& proofOfAdoption) {
SkASSERT(i < this->count());
SkASSERT(Existing::kType == fRecords[i].type());
@@ -186,7 +186,7 @@ private:
// fRecords needs to be a data structure that can append fixed length data, and need to
// support efficient random access and forward iteration. (It doesn't need to be contiguous.)
- unsigned fCount, fReserved;
+ int fCount, fReserved;
SkAutoSTMalloc<kInlineRecords, Record> fRecords;
// fAlloc needs to be a data structure which can append variable length data in contiguous
« no previous file with comments | « src/core/SkRTree.cpp ('k') | src/core/SkRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698