aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextureOpList.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-27 17:51:55 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-28 14:25:54 +0000
commit3a9710b1e40f327779dae18f71c81c7fb3aa3ee0 (patch)
treefed6a6aaa30d801af23ff70df9e84f2840f62d04 /src/gpu/GrTextureOpList.cpp
parent6cf20044d88d45e05f6c6d583254022a87074750 (diff)
Add handling for allocation failure in GrTextureOpList
I believe this is what has been causing the intermittent TSAN crash Change-Id: Ie7170a3eb0495cebe8b1398a00f98ad099f78944 Reviewed-on: https://skia-review.googlesource.com/116629 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrTextureOpList.cpp')
-rw-r--r--src/gpu/GrTextureOpList.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gpu/GrTextureOpList.cpp b/src/gpu/GrTextureOpList.cpp
index ad00d95a00..45deb2d59b 100644
--- a/src/gpu/GrTextureOpList.cpp
+++ b/src/gpu/GrTextureOpList.cpp
@@ -51,6 +51,7 @@ void GrTextureOpList::dump() const {
#endif
void GrTextureOpList::onPrepare(GrOpFlushState* flushState) {
+ SkASSERT(fTarget.get()->priv().peekTexture());
SkASSERT(this->isClosed());
// Loop over the ops that haven't yet generated their geometry
@@ -74,12 +75,18 @@ bool GrTextureOpList::onExecute(GrOpFlushState* flushState) {
return false;
}
+ SkASSERT(fTarget.get()->priv().peekTexture());
+
std::unique_ptr<GrGpuTextureCommandBuffer> commandBuffer(
flushState->gpu()->createCommandBuffer(fTarget.get()->priv().peekTexture(),
fTarget.get()->origin()));
flushState->setCommandBuffer(commandBuffer.get());
for (int i = 0; i < fRecordedOps.count(); ++i) {
+ if (!fRecordedOps[i]) {
+ continue;
+ }
+
GrOpFlushState::OpArgs opArgs = {
fRecordedOps[i].get(),
nullptr,