Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(702)

Issue 6186043: Fixed texture ref/unref bug in GrInOrderDrawBuffer/GrDrawState (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by robertphillips
Modified:
12 years, 2 months ago
Reviewers:
TomH
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

When the gpu rendering path uses GrInOrderDrawBuffer to buffer path drawing GrInOrderDrawBuffer adds refs to the textures stored in GrDrawState. When the paths are played back an AA clip mask may be generated and inserted into the current draw state. Then, when GrInOrderDrawBuffer clears the state and unrefs the textures, this leads to a premature freeing of the AA clip mask. This patch addresses this issue by adding a flag to the GrDrawState that lets it know when it should ref/unref textures in setTexture. I also explored having GrDrawState always ref its textures but this was far more intrusive and changed the lifetime of several objects. A longer term fix might be to refactor GrInOrderDrawBuffer so it provides a better wrapping of the drawing process.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -1 line) Patch
M src/gpu/GrDrawState.h View 2 chunks +16 lines, -0 lines 0 comments Download
M src/gpu/GrInOrderDrawBuffer.cpp View 2 chunks +8 lines, -0 lines 0 comments Download
M src/gpu/gl/GrGpuGL.cpp View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 3
robertphillips
12 years, 2 months ago (2012-05-03 17:39:03 UTC) #1
TomH
LGTM. +1 for filing a Skia issue to explore the longer-term-fix mentioned.
12 years, 2 months ago (2012-05-03 17:40:55 UTC) #2
robertphillips
12 years, 2 months ago (2012-05-03 18:00:39 UTC) #3
Create issue 594 (Refactor GrInOrderDrawBuffer to provide better encapsulation
of render buffering - http://code.google.com/p/skia/issues/detail?id=594)

committed as r3832
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b