aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/mock
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-04-18 13:24:25 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-18 20:00:53 +0000
commit91ab15588451be2f7ec87635590f1e4f90bbbf9a (patch)
tree81c7c8e4519675b086fdb0a0bd323883e7fd3037 /src/gpu/mock
parent15a64e71f68f7d1fcd16247c3d30375d3e2f41e8 (diff)
Always call endFlush on opLists that might survive a flush
We were missing a few that got unreffed due to failed proxy instantiation. Bug: skia:7655 Bug: skia:7111 Change-Id: I95847a16890f2993a1433d4d9fdaa8a4a6c2f0b6 Reviewed-on: https://skia-review.googlesource.com/122121 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/mock')
-rw-r--r--src/gpu/mock/GrMockGpu.cpp7
-rw-r--r--src/gpu/mock/GrMockGpu.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/gpu/mock/GrMockGpu.cpp b/src/gpu/mock/GrMockGpu.cpp
index 0d4cf6296b..59c04af1ad 100644
--- a/src/gpu/mock/GrMockGpu.cpp
+++ b/src/gpu/mock/GrMockGpu.cpp
@@ -69,12 +69,17 @@ void GrMockGpu::submitCommandBuffer(const GrMockGpuRTCommandBuffer* cmdBuffer) {
GrMockGpu::GrMockGpu(GrContext* context, const GrMockOptions& options,
const GrContextOptions& contextOptions)
- : INHERITED(context) {
+ : INHERITED(context)
+ , fMockOptions(options) {
fCaps.reset(new GrMockCaps(contextOptions, options));
}
sk_sp<GrTexture> GrMockGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted,
const GrMipLevel texels[], int mipLevelCount) {
+ if (fMockOptions.fFailTextureAllocations) {
+ return nullptr;
+ }
+
GrMipMapsStatus mipMapsStatus = mipLevelCount > 1 ? GrMipMapsStatus::kValid
: GrMipMapsStatus::kNotAllocated;
GrMockTextureInfo texInfo;
diff --git a/src/gpu/mock/GrMockGpu.h b/src/gpu/mock/GrMockGpu.h
index 73e6a4bfc5..0b3ef079cf 100644
--- a/src/gpu/mock/GrMockGpu.h
+++ b/src/gpu/mock/GrMockGpu.h
@@ -126,6 +126,8 @@ private:
void testingOnly_flushGpuAndSync() override {}
#endif
+ const GrMockOptions fMockOptions;
+
static int NextInternalTextureID();
static int NextExternalTextureID();
static int NextInternalRenderTargetID();