Make GrOp base class responsible for merging bounds.
Change-Id: If85c00554f46c9601ca3fc3ef95bbf7c5bc81dc0
Reviewed-on: https://skia-review.googlesource.com/c/164686
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/ops/GrOp.cpp b/src/gpu/ops/GrOp.cpp
index d6420af..2d591bd 100644
--- a/src/gpu/ops/GrOp.cpp
+++ b/src/gpu/ops/GrOp.cpp
@@ -41,8 +41,11 @@
auto result = this->onCombineIfPossible(that, caps);
// Merging a chained 'that' would cause problems given the way op lists currently manage chains.
SkASSERT(!(thatWasChained && result == CombineResult::kMerged));
- if (fChainHead && result == CombineResult::kMerged) {
- fChainHead->joinBounds(*that);
+ if (result == CombineResult::kMerged) {
+ this->joinBounds(*that);
+ if (fChainHead) {
+ fChainHead->joinBounds(*that);
+ }
}
return result;
}