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

Unified Diff: src/gpu/SkGrPixelRef.cpp

Issue 608883003: GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: remove todo Created 6 years, 2 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/SkGr.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGrPixelRef.cpp
diff --git a/src/gpu/SkGrPixelRef.cpp b/src/gpu/SkGrPixelRef.cpp
index 489a418ce6387bde9a14bd6d77ff171983ccd476..448f2d3931ce233b69672306bcdaf2d942e784c0 100644
--- a/src/gpu/SkGrPixelRef.cpp
+++ b/src/gpu/SkGrPixelRef.cpp
@@ -99,8 +99,7 @@ static SkGrPixelRef* copy_to_new_texture_pixelref(GrTexture* texture, SkColorTyp
///////////////////////////////////////////////////////////////////////////////
-SkGrPixelRef::SkGrPixelRef(const SkImageInfo& info, GrSurface* surface,
- bool transferCacheLock) : INHERITED(info) {
+SkGrPixelRef::SkGrPixelRef(const SkImageInfo& info, GrSurface* surface) : INHERITED(info) {
// For surfaces that are both textures and render targets, the texture owns the
// render target but not vice versa. So we ref the texture to keep both alive for
// the lifetime of this pixel ref.
@@ -108,7 +107,6 @@ SkGrPixelRef::SkGrPixelRef(const SkImageInfo& info, GrSurface* surface,
if (NULL == fSurface) {
fSurface = SkSafeRef(surface);
}
- fUnlock = transferCacheLock;
if (fSurface) {
SkASSERT(info.width() <= fSurface->width());
@@ -117,13 +115,6 @@ SkGrPixelRef::SkGrPixelRef(const SkImageInfo& info, GrSurface* surface,
}
SkGrPixelRef::~SkGrPixelRef() {
- if (fUnlock) {
- GrContext* context = fSurface->getContext();
- GrTexture* texture = fSurface->asTexture();
- if (context && texture) {
- context->unlockScratchTexture(texture);
- }
- }
SkSafeUnref(fSurface);
}
« no previous file with comments | « src/gpu/SkGr.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698