60 inline ElementIter
begin()
const;
61 inline ElementIter
end()
const;
91 bool outsetBoundsForAA,
131 enum class SimplifyResult {
137 static SimplifyResult
Simplify(
const TransformedShape&
a,
const TransformedShape&
b);
140 class RawElement :
public Element {
144 RawElement(
const Rect& deviceBounds,
157 RawElement(
const RawElement&) =
default;
158 RawElement& operator=(
const RawElement&) =
default;
160 operator TransformedShape()
const;
165 const Rect& outerBounds()
const {
return fOuterBounds; }
166 const Rect& innerBounds()
const {
return fInnerBounds; }
173 bool isInvalid()
const {
return fInvalidatedByIndex >= 0; }
174 void markInvalid(
const SaveRecord& current);
175 void restoreValid(
const SaveRecord& current);
189 void updateForElement(RawElement* added,
const SaveRecord& current);
192 enum class DrawInfluence {
197 DrawInfluence testForDraw(
const TransformedShape&
draw)
const;
210 const Rect& drawBounds,
216 void drawClip(Device*);
218 void validate()
const;
226 bool combine(
const RawElement& other,
const SaveRecord& current);
248 int fInvalidatedByIndex;
258 explicit SaveRecord(
const Rect& deviceBounds);
260 SaveRecord(
const SaveRecord& prior,
int startingElementIndex);
262 const SkShader* shader()
const {
return fShader.get(); }
263 const Rect& outerBounds()
const {
return fOuterBounds; }
264 const Rect& innerBounds()
const {
return fInnerBounds; }
265 SkClipOp op()
const {
return fStackOp; }
268 int firstActiveElementIndex()
const {
return fStartingElementIndex; }
269 int oldestElementIndex()
const {
return fOldestValidIndex; }
270 bool canBeUpdated()
const {
return (fDeferredSaveCount == 0); }
272 Rect scissor(
const Rect& deviceBounds,
const Rect& drawBounds)
const;
277 fDeferredSaveCount++;
281 fDeferredSaveCount--;
283 return fDeferredSaveCount >= 0;
288 bool addElement(RawElement&& toAdd, RawElement::Stack* elements, Device*);
295 void removeElements(RawElement::Stack* elements, Device*);
298 void restoreElements(RawElement::Stack* elements);
304 bool appendElement(RawElement&& toAdd, RawElement::Stack* elements, Device*);
305 void replaceWithElement(RawElement&& toAdd, RawElement::Stack* elements, Device*);
315 const int fStartingElementIndex;
316 int fOldestValidIndex;
317 int fDeferredSaveCount;
325 Rect deviceBounds()
const;
327 const SaveRecord& currentSaveRecord()
const {
329 return fSaves.
back();
334 SaveRecord& writableSaveRecord(
bool* wasDeferred);
336 RawElement::Stack fElements;
337 SaveRecord::Stack fSaves;
skgpu::graphite::Transform Transform