aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-07-27 14:15:10 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-27 20:42:46 +0000
commit79f99f7bf22859f4cee31ee6652141b507ea7141 (patch)
treec24e5e55305c692c98d30deb1c0ec4e7220968c8
parent1552a43ab25a34afb7ffc5d48e86c11cda835e8b (diff)
Fix a crash in the clockwise gm
Bug: skia: Change-Id: Idc441d15bb03ef57ba82bb59249cce0c220c0488 Reviewed-on: https://skia-review.googlesource.com/144141 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
-rw-r--r--gm/clockwise.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/gm/clockwise.cpp b/gm/clockwise.cpp
index 3c01a99372..0ca6e0a567 100644
--- a/gm/clockwise.cpp
+++ b/gm/clockwise.cpp
@@ -120,6 +120,9 @@ private:
sk_sp<GrBuffer> vertexBuffer(flushState->resourceProvider()->createBuffer(
sizeof(vertices), kVertex_GrBufferType, kStatic_GrAccessPattern,
GrResourceProvider::kNone_Flag, vertices));
+ if (!vertexBuffer) {
+ return;
+ }
GrPipeline pipeline(flushState->drawOpArgs().fProxy, GrPipeline::ScissorState::kDisabled,
SkBlendMode::kPlus);
GrMesh mesh(GrPrimitiveType::kTriangleStrip);
@@ -155,7 +158,7 @@ void ClockwiseGM::onDraw(SkCanvas* canvas) {
// Draw the test to an off-screen, top-down render target.
if (auto topLeftRTC = ctx->contextPriv().makeDeferredRenderTargetContext(
- SkBackingFit::kExact, 100, 200, rtc->accessRenderTarget()->config(),
+ SkBackingFit::kExact, 100, 200, rtc->asSurfaceProxy()->config(),
nullptr, 1, GrMipMapped::kNo, kTopLeft_GrSurfaceOrigin, nullptr,
SkBudgeted::kYes)) {
topLeftRTC->clear(nullptr, 0, GrRenderTargetContext::CanClearFullscreen::kYes);
@@ -170,7 +173,7 @@ void ClockwiseGM::onDraw(SkCanvas* canvas) {
// Draw the test to an off-screen, bottom-up render target.
if (auto topLeftRTC = ctx->contextPriv().makeDeferredRenderTargetContext(
- SkBackingFit::kExact, 100, 200, rtc->accessRenderTarget()->config(),
+ SkBackingFit::kExact, 100, 200, rtc->asSurfaceProxy()->config(),
nullptr, 1, GrMipMapped::kNo, kBottomLeft_GrSurfaceOrigin, nullptr,
SkBudgeted::kYes)) {
topLeftRTC->clear(nullptr, 0, GrRenderTargetContext::CanClearFullscreen::kYes);