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

Unified Diff: src/gpu/GrTest.cpp

Issue 1187523005: Add support for creating texture backed images where Skia will delete the texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add default param to support Chrome's current callers Created 5 years, 6 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/gpu/GrResourceCache.cpp ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTest.cpp
diff --git a/src/gpu/GrTest.cpp b/src/gpu/GrTest.cpp
index 7a754bc9f236788b926702b65679a1e05fb94561..470bc5873ef83f65f06a1c9132931ca9ad5e0932 100644
--- a/src/gpu/GrTest.cpp
+++ b/src/gpu/GrTest.cpp
@@ -79,17 +79,25 @@ void GrResourceCache::dumpStats(SkString* out) const {
struct Stats {
int fScratch;
- int fWrapped;
+ int fExternal;
+ int fBorrowed;
+ int fAdopted;
size_t fUnbudgetedSize;
- Stats() : fScratch(0), fWrapped(0), fUnbudgetedSize(0) {}
+ Stats() : fScratch(0), fExternal(0), fBorrowed(0), fAdopted(0), fUnbudgetedSize(0) {}
void update(GrGpuResource* resource) {
if (resource->cacheAccess().isScratch()) {
++fScratch;
}
- if (resource->cacheAccess().isWrapped()) {
- ++fWrapped;
+ if (resource->cacheAccess().isExternal()) {
+ ++fExternal;
+ }
+ if (resource->cacheAccess().isBorrowed()) {
+ ++fBorrowed;
+ }
+ if (resource->cacheAccess().isAdopted()) {
+ ++fAdopted;
}
if (!resource->resourcePriv().isBudgeted()) {
fUnbudgetedSize += resource->gpuMemorySize();
@@ -111,9 +119,9 @@ void GrResourceCache::dumpStats(SkString* out) const {
out->appendf("Budget: %d items %d bytes\n", fMaxCount, (int)fMaxBytes);
out->appendf("\t\tEntry Count: current %d"
- " (%d budgeted, %d wrapped, %d locked, %d scratch %.2g%% full), high %d\n",
- this->getResourceCount(), fBudgetedCount, stats.fWrapped, locked, stats.fScratch,
- countUtilization, fHighWaterCount);
+ " (%d budgeted, %d external(%d borrowed, %d adopted), %d locked, %d scratch %.2g%% full), high %d\n",
+ this->getResourceCount(), fBudgetedCount, stats.fExternal, stats.fBorrowed,
+ stats.fAdopted, locked, stats.fScratch, countUtilization, fHighWaterCount);
out->appendf("\t\tEntry Bytes: current %d (budgeted %d, %.2g%% full, %d unbudgeted) high %d\n",
SkToInt(fBytes), SkToInt(fBudgetedBytes), byteUtilization,
SkToInt(stats.fUnbudgetedSize), SkToInt(fHighWaterBytes));
@@ -179,9 +187,11 @@ private:
return NULL;
}
- GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) override { return NULL; }
+ GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&,
+ GrWrapOwnership) override { return NULL; }
- GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&) override {
+ GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&,
+ GrWrapOwnership) override {
return NULL;
}
« no previous file with comments | « src/gpu/GrResourceCache.cpp ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698