Split GrResourceAllocator::assign into two methods
A follow-up CL allows the user to check the budget headroom
in between these two steps.
Bug: skia:10877
Change-Id: Ie0e6f23029065158b2eadb0dc26caf32f54433e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/394999
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp
index bdc3f98..f0eed7b 100644
--- a/src/gpu/GrSurfaceProxy.cpp
+++ b/src/gpu/GrSurfaceProxy.cpp
@@ -154,7 +154,10 @@
SkASSERT(fTarget->asRenderTarget());
}
- if (kInvalidGpuMemorySize != this->getRawGpuMemorySize_debugOnly()) {
+ // In order to give DDL users some flexibility in the destination of there DDLs,
+ // a DDL's target proxy can be more conservative (and thus require less memory)
+ // than the actual GrSurface used to fulfill it.
+ if (!this->isDDLTarget() && kInvalidGpuMemorySize != this->getRawGpuMemorySize_debugOnly()) {
// TODO(11373): Can this check be exact?
SkASSERT(fTarget->gpuMemorySize() <= this->getRawGpuMemorySize_debugOnly());
}