aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
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
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')
-rw-r--r--src/gpu/GrDrawingManager.cpp2
-rw-r--r--src/gpu/GrRenderTargetOpList.cpp4
-rw-r--r--src/gpu/GrRenderTargetOpList.h2
-rw-r--r--src/gpu/GrTextureOpList.cpp7
4 files changed, 11 insertions, 4 deletions
diff --git a/src/gpu/GrDrawingManager.cpp b/src/gpu/GrDrawingManager.cpp
index 8ebcc85455..d9af37dcaa 100644
--- a/src/gpu/GrDrawingManager.cpp
+++ b/src/gpu/GrDrawingManager.cpp
@@ -391,8 +391,8 @@ sk_sp<GrRenderTargetOpList> GrDrawingManager::newRTOpList(GrRenderTargetProxy* r
auto resourceProvider = fContext->contextPriv().resourceProvider();
sk_sp<GrRenderTargetOpList> opList(new GrRenderTargetOpList(
- rtp,
resourceProvider,
+ rtp,
fContext->contextPriv().getAuditTrail()));
SkASSERT(rtp->getLastOpList() == opList.get());
diff --git a/src/gpu/GrRenderTargetOpList.cpp b/src/gpu/GrRenderTargetOpList.cpp
index ccf2b78385..2d26d14281 100644
--- a/src/gpu/GrRenderTargetOpList.cpp
+++ b/src/gpu/GrRenderTargetOpList.cpp
@@ -24,8 +24,8 @@
static const int kMaxOpLookback = 10;
static const int kMaxOpLookahead = 10;
-GrRenderTargetOpList::GrRenderTargetOpList(GrRenderTargetProxy* proxy,
- GrResourceProvider* resourceProvider,
+GrRenderTargetOpList::GrRenderTargetOpList(GrResourceProvider* resourceProvider,
+ GrRenderTargetProxy* proxy,
GrAuditTrail* auditTrail)
: INHERITED(resourceProvider, proxy, auditTrail)
, fLastClipStackGenID(SK_InvalidUniqueID)
diff --git a/src/gpu/GrRenderTargetOpList.h b/src/gpu/GrRenderTargetOpList.h
index 6bbd1cb837..c0a72333da 100644
--- a/src/gpu/GrRenderTargetOpList.h
+++ b/src/gpu/GrRenderTargetOpList.h
@@ -32,7 +32,7 @@ private:
using DstProxy = GrXferProcessor::DstProxy;
public:
- GrRenderTargetOpList(GrRenderTargetProxy*, GrResourceProvider*, GrAuditTrail*);
+ GrRenderTargetOpList(GrResourceProvider*, GrRenderTargetProxy*, GrAuditTrail*);
~GrRenderTargetOpList() override;
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,