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

Issue 4328044: GrResource (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 7 months ago by bsalomon
Modified:
13 years, 7 months ago
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

This change adds a new parent class to vbs, ibs, textures, and rts: GrResource. The GrGpu object maintains a linked list of all the GrResources it has created so that they can be freed or abandoned by the GrContext when the GrContext is destroyed or the underlying 3D context is lost. GrResources can outlive the GrContext if the client has kept a ref on them, but they will be marked as invalid. Motivations: Enables safe shutdown of a GrContext after the 3D context has already gone away. SkBitmaps created on a SkGpuDevice are texture backed and have a pointer to GrTexture. The SkBitmap's lifetime is independent of GrContext. When the pixels of a SkBitmap are accessed we will be able to query GrResource to know whether a readback can be performed or if the underlying texture has been freed and we must fail. (Actually adding this plumbing will be a separate change.)

Patch Set 1 #

Patch Set 2 : comment changes, etc #

Patch Set 3 : Remove force flag and other misc changes #

Total comments: 1

Patch Set 4 : add grresource files to svn #

Total comments: 3

Patch Set 5 : address review comments #

Patch Set 6 : add this-> to setupDrawBuffer/flush calls in GrContext.cpp #

Unified diffs Side-by-side diffs Delta from patch set Stats (+574 lines, -316 lines) Patch
M gpu/include/GrAtlas.h View 1 chunk +0 lines, -2 lines 0 comments Download
M gpu/include/GrContext.h View 1 2 3 chunks +21 lines, -6 lines 0 comments Download
M gpu/include/GrGLIndexBuffer.h View 1 1 chunk +17 lines, -12 lines 0 comments Download
M gpu/include/GrGLTexture.h View 5 chunks +52 lines, -45 lines 0 comments Download
M gpu/include/GrGLVertexBuffer.h View 1 chunk +14 lines, -12 lines 0 comments Download
M gpu/include/GrGeometryBuffer.h View 3 chunks +35 lines, -41 lines 0 comments Download
M gpu/include/GrGpu.h View 1 4 chunks +28 lines, -2 lines 0 comments Download
M gpu/include/GrIndexBuffer.h View 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/include/GrRefCnt.h View 1 chunk +8 lines, -0 lines 0 comments Download
A gpu/include/GrResource.h View 1 2 3 4 1 chunk +77 lines, -0 lines 0 comments Download
M gpu/include/GrTextStrike.h View 1 chunk +0 lines, -1 line 0 comments Download
M gpu/include/GrTexture.h View 9 chunks +27 lines, -25 lines 0 comments Download
M gpu/include/GrTextureCache.h View 2 chunks +2 lines, -6 lines 0 comments Download
M gpu/include/GrVertexBuffer.h View 1 chunk +2 lines, -2 lines 0 comments Download
M gpu/src/GrAtlas.cpp View 1 chunk +0 lines, -12 lines 0 comments Download
M gpu/src/GrContext.cpp View 1 2 3 4 5 6 chunks +44 lines, -16 lines 0 comments Download
M gpu/src/GrGLIndexBuffer.cpp View 1 2 4 chunks +27 lines, -24 lines 0 comments Download
M gpu/src/GrGLTexture.cpp View 8 chunks +39 lines, -29 lines 0 comments Download
M gpu/src/GrGLVertexBuffer.cpp View 4 chunks +28 lines, -24 lines 0 comments Download
M gpu/src/GrGpu.cpp View 1 2 2 chunks +80 lines, -19 lines 0 comments Download
M gpu/src/GrGpuGL.cpp View 7 chunks +7 lines, -7 lines 0 comments Download
A gpu/src/GrResource.cpp View 1 2 3 1 chunk +41 lines, -0 lines 0 comments Download
M gpu/src/GrTextStrike.cpp View 1 chunk +2 lines, -9 lines 0 comments Download
M gpu/src/GrTextureCache.cpp View 3 chunks +2 lines, -5 lines 0 comments Download
M gyp/skia.gyp View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M include/gpu/SkGr.h View 1 chunk +0 lines, -8 lines 0 comments Download
M samplecode/SampleApp.cpp View 1 2 1 chunk +9 lines, -2 lines 0 comments Download
M src/gpu/SkGr.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M xcode/gpu/gpu.xcodeproj/project.pbxproj View 6 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 9
bsalomon
13 years, 7 months ago (2011-03-30 18:13:43 UTC) #1
reed1
LGTM
13 years, 7 months ago (2011-03-30 18:32:11 UTC) #2
Stephen White
LG, modulo nits. Does this need a change to skia.gyp also? http://codereview.appspot.com/4328044/diff/11001/gpu/include/GrGeometryBuffer.h File gpu/include/GrGeometryBuffer.h (right): ...
13 years, 7 months ago (2011-03-30 18:54:14 UTC) #3
twiz1
Quick drive-by. Just a nit, and a question. Jeff http://codereview.appspot.com/4328044/diff/3029/gpu/src/GrGLIndexBuffer.cpp File gpu/src/GrGLIndexBuffer.cpp (right): http://codereview.appspot.com/4328044/diff/3029/gpu/src/GrGLIndexBuffer.cpp#newcode60 gpu/src/GrGLIndexBuffer.cpp:60: ...
13 years, 7 months ago (2011-03-30 19:10:28 UTC) #4
reed1
this->method(); This is encouraged for all skia code. On 2011/03/30 19:10:28, twiz1 wrote: > Quick ...
13 years, 7 months ago (2011-03-30 20:06:46 UTC) #5
reed1
13 years, 7 months ago (2011-03-30 20:10:13 UTC) #6
bsalomon
Thanks for the reviews! On 2011/03/30 18:54:14, Stephen White wrote: > > Does this need ...
13 years, 7 months ago (2011-03-30 20:13:01 UTC) #7
twiz1
On 2011/03/30 20:06:46, reed1 wrote: > this->method(); > > This is encouraged for all skia ...
13 years, 7 months ago (2011-03-30 20:21:24 UTC) #8
bsalomon
13 years, 7 months ago (2011-03-30 21:27:59 UTC) #9
checked in as r1026, closed.
Sign in to reply to this message.

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