aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-07-10 14:14:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-10 14:14:03 -0700
commit398920532291cb47d44b992fa2e56dd37f8ec195 (patch)
tree790e866693cfc7e76d76ac0641821d76931ed577 /src/gpu
parentd0f4173fb04def5f864519a49c421a7b19df72b7 (diff)
remove some unused stuff
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrPlotMgr.h73
-rw-r--r--src/gpu/GrTBSearch.h44
-rw-r--r--src/gpu/GrTemplates.h43
3 files changed, 0 insertions, 160 deletions
diff --git a/src/gpu/GrPlotMgr.h b/src/gpu/GrPlotMgr.h
deleted file mode 100644
index 1441611327..0000000000
--- a/src/gpu/GrPlotMgr.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrPlotMgr_DEFINED
-#define GrPlotMgr_DEFINED
-
-#include "GrTypes.h"
-#include "SkTypes.h"
-
-class GrPlotMgr : SkNoncopyable {
-public:
- GrPlotMgr(int width, int height) {
- fDim.set(width, height);
- size_t needed = width * height;
- if (needed <= sizeof(fStorage)) {
- fBusy = fStorage;
- } else {
- fBusy = SkNEW_ARRAY(char, needed);
- }
- this->reset();
- }
-
- ~GrPlotMgr() {
- if (fBusy != fStorage) {
- delete[] fBusy;
- }
- }
-
- void reset() {
- sk_bzero(fBusy, fDim.fX * fDim.fY);
- }
-
- bool newPlot(SkIPoint16* loc) {
- char* busy = fBusy;
- for (int y = 0; y < fDim.fY; y++) {
- for (int x = 0; x < fDim.fX; x++) {
- if (!*busy) {
- *busy = true;
- loc->set(x, y);
- return true;
- }
- busy++;
- }
- }
- return false;
- }
-
- bool isBusy(int x, int y) const {
- SkASSERT((unsigned)x < (unsigned)fDim.fX);
- SkASSERT((unsigned)y < (unsigned)fDim.fY);
- return fBusy[y * fDim.fX + x] != 0;
- }
-
- void freePlot(int x, int y) {
- SkASSERT((unsigned)x < (unsigned)fDim.fX);
- SkASSERT((unsigned)y < (unsigned)fDim.fY);
- fBusy[y * fDim.fX + x] = false;
- }
-
-private:
- enum {
- STORAGE = 64
- };
- char fStorage[STORAGE];
- char* fBusy;
- SkIPoint16 fDim;
-};
-
-#endif
diff --git a/src/gpu/GrTBSearch.h b/src/gpu/GrTBSearch.h
deleted file mode 100644
index 01e97440a6..0000000000
--- a/src/gpu/GrTBSearch.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2010 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrTBSearch_DEFINED
-#define GrTBSearch_DEFINED
-
-#include "SkTypes.h"
-
-template <typename ELEM, typename KEY>
-int GrTBSearch(const ELEM array[], int count, KEY target) {
- SkASSERT(count >= 0);
- if (0 == count) {
- // we should insert it at 0
- return ~0;
- }
-
- int high = count - 1;
- int low = 0;
- while (high > low) {
- int index = (low + high) >> 1;
- if (LT(array[index], target)) {
- low = index + 1;
- } else {
- high = index;
- }
- }
-
- // check if we found it
- if (EQ(array[high], target)) {
- return high;
- }
-
- // now return the ~ of where we should insert it
- if (LT(array[high], target)) {
- high += 1;
- }
- return ~high;
-}
-
-#endif
diff --git a/src/gpu/GrTemplates.h b/src/gpu/GrTemplates.h
index 8e43a15f7b..8eab9c5ef3 100644
--- a/src/gpu/GrTemplates.h
+++ b/src/gpu/GrTemplates.h
@@ -22,47 +22,4 @@ template <typename Dst, typename Src> Dst GrTCast(Src src) {
return data.dst;
}
-/**
- * takes a T*, saves the value it points to, in and restores the value in the
- * destructor
- * e.g.:
- * {
- * GrAutoTRestore<int*> autoCountRestore;
- * if (useExtra) {
- * autoCountRestore.reset(&fCount);
- * fCount += fExtraCount;
- * }
- * ...
- * } // fCount is restored
- */
-template <typename T> class GrAutoTRestore : SkNoncopyable {
-public:
- GrAutoTRestore() : fPtr(NULL), fVal() {}
-
- GrAutoTRestore(T* ptr) {
- fPtr = ptr;
- if (ptr) {
- fVal = *ptr;
- }
- }
-
- ~GrAutoTRestore() {
- if (fPtr) {
- *fPtr = fVal;
- }
- }
-
- // restores previously saved value (if any) and saves value for passed T*
- void reset(T* ptr) {
- if (fPtr) {
- *fPtr = fVal;
- }
- fPtr = ptr;
- fVal = *ptr;
- }
-private:
- T* fPtr;
- T fVal;
-};
-
#endif