|
Refactor to separate backend object lifecycle and GpuResource budget decision
Refactor GrGpuResource to contain two different pieces of state:
a) instance is budgeted or not budgeted
b) instance references wrapped backend objects or not
The "object lifecycle" was also attached to backend object
handles (ids), which made the code a bit unclear. Backend objects
would be associated with GrGpuResource::LifeCycle, even though
GrGpuResource::LifeCycle refers to the GpuResource, and individual
backend objects in one GpuResource might be governed with different
"lifecycle".
Mark the budgeted/not budgeted with SkBudgeted::kYes, SkBudgeted::kNo.
This was previously GrGpuResource::kCached_LifeCycle,
GrGpuResource::kUncached_LifeCycle.
Mark the "references wrapped object" with boolean. This was previously
GrGpuResource::kBorrowed_LifeCycle,
GrGpuResource::kAdopted_LifeCycle for GrGpuResource.
Associate the backend object ownership status with
GrBackendObjectOwnership for the backend object handles.
The resource type leaf constuctors, such has GrGLTexture or
GrGLTextureRenderTarget take "budgeted" parameter. This parameter
is passed to GrGpuResource::registerWithCache().
The resource type intermediary constructors, such as GrGLTexture
constructors for class GrGLTextureRenderTarget do not take "budgeted"
parameters, intermediary construtors do not call registerWithCache.
Removes the need for tagging GrGpuResource -derived subclass
constructors with "Derived" parameter.
Makes instances that wrap backend objects be registered with
a new function GrGpuResource::registerWithCacheWrapped().
Removes "budgeted" parameter from classes such as StencilAttahment, as
they are always cached and never wrap any external backend objects.
Removes the use of concept "external" from the member function names.
The API refers to the objects as "wrapped", so make all related
functions use the term consistently.
No change in functionality. Resources referencing wrapped objects are
always inserted to the cache with budget decision kNo.
BUG= 594928
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1862043002
Committed: https://skia.googlesource.com/skia/+/2e6055b3ea14a04fcde1ac1974a70bf00b1e295b
Total comments: 4
Total comments: 3
Total comments: 3
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+446 lines, -439 lines) |
Patch |
|
M |
bench/GrResourceCacheBench.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
include/gpu/GrBuffer.h
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+9 lines, -7 lines |
0 comments
|
Download
|
|
M |
include/gpu/GrGpuResource.h
|
View
|
1
2
3
4
5
6
|
6 chunks |
+19 lines, -46 lines |
0 comments
|
Download
|
|
M |
include/gpu/GrRenderTarget.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
include/gpu/GrSurface.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
include/gpu/GrTexture.h
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
include/gpu/GrTypesPriv.h
|
View
|
1
2
3
4
|
1 chunk |
+10 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrGpu.h
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrGpu.cpp
|
View
|
1
2
|
2 chunks |
+2 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrGpuResource.cpp
|
View
|
|
3 chunks |
+20 lines, -17 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrGpuResourceCacheAccess.h
|
View
|
|
1 chunk |
+0 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrGpuResourcePriv.h
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrPath.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/gpu/GrPathRange.cpp
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrResourceCache.h
|
View
|
|
3 chunks |
+4 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrResourceCache.cpp
|
View
|
|
3 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrStencilAttachment.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/gpu/GrTexture.cpp
|
View
|
1
2
|
2 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLBuffer.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLGpu.h
|
View
|
1
2
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLGpu.cpp
|
View
|
1
2
3
|
11 chunks |
+23 lines, -33 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLPath.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLPathRange.cpp
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLRenderTarget.h
|
View
|
1
2
3
|
4 chunks |
+6 lines, -15 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLRenderTarget.cpp
|
View
|
1
2
3
4
5
|
4 chunks |
+19 lines, -10 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLStencilAttachment.h
|
View
|
|
1 chunk |
+7 lines, -8 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLStencilAttachment.cpp
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLTexture.h
|
View
|
1
2
3
|
4 chunks |
+12 lines, -14 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLTexture.cpp
|
View
|
1
2
3
4
5
|
3 chunks |
+28 lines, -13 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLTextureRenderTarget.h
|
View
|
1
2
3
4
5
|
2 chunks |
+21 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/gpu/gl/GrGLTextureRenderTarget.cpp
|
View
|
1
2
3
4
5
|
1 chunk |
+13 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkGpu.h
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkGpu.cpp
|
View
|
1
2
3
4
5
|
7 chunks |
+6 lines, -16 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkIndexBuffer.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkRenderTarget.h
|
View
|
|
3 chunks |
+7 lines, -15 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkRenderTarget.cpp
|
View
|
1
2
3
4
5
|
12 chunks |
+24 lines, -33 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkStencilAttachment.h
|
View
|
|
2 chunks |
+1 line, -3 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkStencilAttachment.cpp
|
View
|
1
2
3
4
5
|
2 chunks |
+3 lines, -5 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkTexture.h
|
View
|
|
3 chunks |
+12 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkTexture.cpp
|
View
|
1
2
3
4
5
|
6 chunks |
+32 lines, -23 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkTextureRenderTarget.h
|
View
|
|
2 chunks |
+48 lines, -18 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkTextureRenderTarget.cpp
|
View
|
1
2
3
4
5
|
7 chunks |
+16 lines, -20 lines |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkTransferBuffer.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/gpu/vk/GrVkVertexBuffer.cpp
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/image/SkSurface_Gpu.cpp
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
tests/ResourceCacheTest.cpp
|
View
|
|
13 chunks |
+51 lines, -44 lines |
0 comments
|
Download
|
|
M |
tools/gpu/GrTest.cpp
|
View
|
1
2
|
2 chunks |
+5 lines, -6 lines |
0 comments
|
Download
|
Total messages: 28 (12 generated)
|