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

Unified Diff: skia/images/SkImageRef_GlobalPool.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/images/SkImageRefPool.cpp ('k') | skia/images/SkMMapStream.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/images/SkImageRef_GlobalPool.cpp
===================================================================
--- skia/images/SkImageRef_GlobalPool.cpp (revision 16859)
+++ skia/images/SkImageRef_GlobalPool.cpp (working copy)
@@ -1,83 +0,0 @@
-#include "SkImageRef_GlobalPool.h"
-#include "SkImageRefPool.h"
-#include "SkThread.h"
-
-extern SkMutex gImageRefMutex;
-
-static SkImageRefPool gGlobalImageRefPool;
-
-SkImageRef_GlobalPool::SkImageRef_GlobalPool(SkStream* stream,
- SkBitmap::Config config,
- int sampleSize)
- : SkImageRef(stream, config, sampleSize) {
- this->mutex()->acquire();
- gGlobalImageRefPool.addToHead(this);
- this->mutex()->release();
-}
-
-SkImageRef_GlobalPool::~SkImageRef_GlobalPool() {
- this->mutex()->acquire();
- gGlobalImageRefPool.detach(this);
- this->mutex()->release();
-}
-
-bool SkImageRef_GlobalPool::onDecode(SkImageDecoder* codec, SkStream* stream,
- SkBitmap* bitmap, SkBitmap::Config config,
- SkImageDecoder::Mode mode) {
- if (!this->INHERITED::onDecode(codec, stream, bitmap, config, mode)) {
- return false;
- }
- if (mode == SkImageDecoder::kDecodePixels_Mode) {
- gGlobalImageRefPool.justAddedPixels(this);
- }
- return true;
-}
-
-void SkImageRef_GlobalPool::onUnlockPixels() {
- this->INHERITED::onUnlockPixels();
-
- gGlobalImageRefPool.canLosePixels(this);
-}
-
-SkImageRef_GlobalPool::SkImageRef_GlobalPool(SkFlattenableReadBuffer& buffer)
- : INHERITED(buffer) {
- this->mutex()->acquire();
- gGlobalImageRefPool.addToHead(this);
- this->mutex()->release();
-}
-
-SkPixelRef* SkImageRef_GlobalPool::Create(SkFlattenableReadBuffer& buffer) {
- return SkNEW_ARGS(SkImageRef_GlobalPool, (buffer));
-}
-
-static SkPixelRef::Registrar::Registrar reg("SkImageRef_GlobalPool",
- SkImageRef_GlobalPool::Create);
-
-///////////////////////////////////////////////////////////////////////////////
-// global imagerefpool wrappers
-
-size_t SkImageRef_GlobalPool::GetRAMBudget() {
- SkAutoMutexAcquire ac(gImageRefMutex);
- return gGlobalImageRefPool.getRAMBudget();
-}
-
-void SkImageRef_GlobalPool::SetRAMBudget(size_t size) {
- SkAutoMutexAcquire ac(gImageRefMutex);
- gGlobalImageRefPool.setRAMBudget(size);
-}
-
-size_t SkImageRef_GlobalPool::GetRAMUsed() {
- SkAutoMutexAcquire ac(gImageRefMutex);
- return gGlobalImageRefPool.getRAMUsed();
-}
-
-void SkImageRef_GlobalPool::SetRAMUsed(size_t usage) {
- SkAutoMutexAcquire ac(gImageRefMutex);
- gGlobalImageRefPool.setRAMUsed(usage);
-}
-
-void SkImageRef_GlobalPool::DumpPool() {
- SkAutoMutexAcquire ac(gImageRefMutex);
- gGlobalImageRefPool.dump();
-}
-
« no previous file with comments | « skia/images/SkImageRefPool.cpp ('k') | skia/images/SkMMapStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698