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

Issue 1793383002: Only recycle "kSampler2D" textures as scratch (Closed)

Created:
4 years, 9 months ago by Chris Dalton
Modified:
4 years, 8 months ago
Reviewers:
joshualitt, bsalomon
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Only recycle "kSampler2D" textures as scratch BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1793383002

Patch Set 1 #

Patch Set 2 : rebase for demo; do not submit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M src/gpu/GrTexture.cpp View 1 chunk +2 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 5 (2 generated)
Chris Dalton
4 years, 9 months ago (2016-03-14 01:46:00 UTC) #3
bsalomon
On 2016/03/14 01:46:00, Chris Dalton wrote: Hm, it's not obvious to me that non-2D textures ...
4 years, 9 months ago (2016-03-16 13:19:31 UTC) #4
Chris Dalton
4 years, 9 months ago (2016-03-16 15:04:23 UTC) #5
On 2016/03/16 13:19:31, bsalomon wrote:
> On 2016/03/14 01:46:00, Chris Dalton wrote:
> 
> Hm, it's not obvious to me that non-2D textures should never be recycled. We
> don't currently recycle RECTANGLE textures. Not because they're RECTANGLE,
> though, but rather because they are created externally. If we started creating
> RECTANGLE textures we wouldn't treat them differently than 2D textures WRT
> recyclability.

Ok. So the main motivation for doing this was that we don't want to recycle
BUFFER textures, which are just a window into some memory that was already owned
by a buffer object. Also, I have a buffer texture class that uses the scratch
key, so that class does not want the GrTexture constructor to call
setScratchKey.

The way I solved this originally was by removing "setScratchKey" from the
GrTexture constructor, and moving it into a separate method that subclasses
would call from their constructor.

Another option would be to just not call setScratchKey for buffer textures.

Do you have a preference?

Powered by Google App Engine
This is Rietveld 408576698