Home | History | Annotate | Download | only in images

Lines Matching refs:ref

30 void SkImageRefPool::justAddedPixels(SkImageRef* ref) {
33 ref->getURI(),
34 ref->fBitmap.width(), ref->fBitmap.height(),
35 ref->fBitmap.bytesPerPixel(),
36 ref->fBitmap.getSize(), (int)fRAMUsed);
38 fRAMUsed += ref->ramUsed();
42 void SkImageRefPool::canLosePixels(SkImageRef* ref) {
45 this->detach(ref);
46 this->addToHead(ref);
58 SkImageRef* ref = fTail;
60 while (NULL != ref && fRAMUsed > limit) {
62 if (!ref->isLocked() && ref->fBitmap.getPixels()) {
63 size_t size = ref->ramUsed();
69 ref->getURI(),
70 ref->fBitmap.width(), ref->fBitmap.height(),
71 ref->fBitmap.bytesPerPixel(),
77 ref->fBitmap.setPixels(NULL);
78 SkASSERT(NULL == ref->fBitmap.getPixels());
80 ref = ref->fPrev;
86 void SkImageRefPool::addToHead(SkImageRef* ref) {
87 ref->fNext = fHead;
88 ref->fPrev = NULL;
92 fHead->fPrev = ref;
94 fHead = ref;
97 fTail = ref;
102 fRAMUsed += ref->ramUsed();
105 void SkImageRefPool::addToTail(SkImageRef* ref) {
106 ref->fNext = NULL;
107 ref->fPrev = fTail;
111 fTail->fNext = ref;
113 fTail = ref;
116 fHead = ref;
121 fRAMUsed += ref->ramUsed();
124 void SkImageRefPool::detach(SkImageRef* ref) {
127 if (fHead == ref) {
128 fHead = ref->fNext;
130 if (fTail == ref) {
131 fTail = ref->fPrev;
133 if (ref->fPrev) {
134 ref->fPrev->fNext = ref->fNext;
136 if (ref->fNext) {
137 ref->fNext->fPrev = ref->fPrev;
140 ref->fNext = ref->fPrev = NULL;
145 SkASSERT(fRAMUsed >= ref->ramUsed());
146 fRAMUsed -= ref->ramUsed();
150 SkImageRef* ref = fHead;
153 while (ref != NULL) {
155 ref = ref->fNext;
159 ref = fTail;
162 while (ref != NULL) {
164 ref = ref->fPrev;
181 SkImageRef* ref = fHead;
183 while (ref != NULL) {
184 SkDebugf(" [%3d %3d %d] ram=%d data=%d locked=%d %s\n", ref->fBitmap.width(),
185 ref->fBitmap.height(), ref->fBitmap.config(),
186 ref->ramUsed(), (int)ref->fStream->getLength(),
187 ref->isLocked(), ref->getURI());
189 ref = ref->fNext;