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

Unified Diff: skia/sgl/SkPtrRecorder.cpp

Issue 113827: Remove the remainder of the skia source code from the Chromium repo.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 | « skia/sgl/SkProcSpriteBlitter.cpp ('k') | skia/sgl/SkRasterizer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/sgl/SkPtrRecorder.cpp
===================================================================
--- skia/sgl/SkPtrRecorder.cpp (revision 16859)
+++ skia/sgl/SkPtrRecorder.cpp (working copy)
@@ -1,53 +0,0 @@
-#include "SkPtrRecorder.h"
-#include "SkTSearch.h"
-
-void SkPtrRecorder::reset() {
- Pair* p = fList.begin();
- Pair* stop = fList.end();
- while (p < stop) {
- this->decPtr(p->fPtr);
- p += 1;
- }
- fList.reset();
-}
-
-int SkPtrRecorder::Cmp(const Pair& a, const Pair& b) {
- return (char*)a.fPtr - (char*)b.fPtr;
-}
-
-uint32_t SkPtrRecorder::recordPtr(void* ptr) {
- if (NULL == ptr) {
- return 0;
- }
-
- int count = fList.count();
- Pair pair;
- pair.fPtr = ptr;
-
- int index = SkTSearch<Pair>(fList.begin(), count, pair, sizeof(pair), &Cmp);
- if (index < 0) {
- index = ~index; // turn it back into an index for insertion
- this->incPtr(ptr);
- pair.fIndex = count + 1;
- *fList.insert(index) = pair;
- return count + 1;
- } else {
- return fList[index].fIndex;
- }
-}
-
-void SkPtrRecorder::getPtrs(void* array[]) const {
- int count = fList.count();
- if (count > 0) {
- SkASSERT(array);
- const Pair* p = fList.begin();
- // p->fIndex is base-1, so we need to subtract to find its slot
- for (int i = 0; i < count; i++) {
- int index = p[i].fIndex - 1;
- SkASSERT((unsigned)index < (unsigned)count);
- array[index] = p[i].fPtr;
- }
- }
-}
-
-
« no previous file with comments | « skia/sgl/SkProcSpriteBlitter.cpp ('k') | skia/sgl/SkRasterizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698