Home | History | Annotate | Download | only in core

Lines Matching refs:Bounds

25         // this canvas' clip bounds transformed back into identity space, which
81 DRAW(SaveLayer, saveLayer(SkCanvas::SaveLayerRec(r.bounds, r.paint, r.backdrop, r.saveLayerFlags)));
135 // The interesting part here is how to calculate bounds for ops which don't
136 // have intrinsic bounds. What is the bounds of a Save or a Translate?
138 // We answer this by thinking about a particular definition of bounds: if I
140 // the bounds of a Save, a Translate, a Restore, etc. are the union of the
141 // bounds of Draw* ops that they might have an effect on. For any given
142 // Save/Restore block, the bounds of the Save, the Restore, and any other
143 // non-drawing ("control") ops inside are exactly the union of the bounds of
147 // inside the Save/Restore block, drawing ops are unioned with the bounds of
149 // block with a Restore, our bounds are complete, and we go back and fill them
153 FillBounds(const SkRect& cullRect, const SkRecord& record, SkRect bounds[])
156 , fBounds(bounds) {
163 // sure all ops in those Save blocks have their bounds calculated.
183 // In this file, SkRect are in local coordinates, Bounds are translated back to identity space.
184 typedef SkRect Bounds;
188 const Bounds& getBounds(int index) const { return fBounds[index]; }
191 Bounds adjustAndMap(SkRect rect, const SkPaint* paint) const {
197 // The paint could do anything to our bounds. The only safe answer is the current clip.
212 return Bounds::MakeEmpty();
221 Bounds bounds; // Bounds of everything in the block.
222 const SkPaint* paint; // Unowned. If set, adjusts the bounds of all ops in this block.
235 // Clip{Path,RRect,Rect,Region} obviously change the clip. They all know their bounds already.
241 // The bounds of clip ops need to be adjusted for the paints of saveLayers they're inside.
243 Bounds clip = SkRect::Make(devBounds);
245 // clip bounds with the previous clip, exactly what we can't do when the clip grows.
247 fCurrentClipBounds = clip.intersect(fCullRect) ? clip : Bounds::MakeEmpty();
260 Bounds clip = SkRect::Make(op.devBounds);
262 fCurrentClipBounds = clip.intersect(fCullRect) ? clip : Bounds::MakeEmpty();
268 // We also take advantage of SaveLayer bounds when present to further cut the clip down.
270 if (op.bounds) {
271 // adjustAndMap() intersects these layer bounds with the previous clip for us.
272 fCurrentClipBounds = this->adjustAndMap(*op.bounds, op.paint);
276 // The bounds of these ops must be calculated when we hit the Restore
277 // from the bounds of the ops in the same Save block.
289 // For all other ops, we can calculate and store the bounds directly now.
291 fBounds[fCurrentOp] = this->bounds(op);
300 // than the current clip bounds.
301 sb.bounds =
302 PaintMayAffectTransparentBlack(paint) ? fCurrentClipBounds : Bounds::MakeEmpty();
350 Bounds popSaveBlock() {
351 // We're done the Save block. Apply the block's bounds to all control ops inside it.
356 this->popControl(sb.bounds);
360 this->updateSaveBounds(sb.bounds);
362 // If called from a real Restore (not a phony one for balance), it'll need the bounds.
363 return sb.bounds;
373 void popControl(const Bounds& bounds) {
374 fBounds[fControlIndices.top()] = bounds;
378 void updateSaveBounds(const Bounds& bounds) {
379 // If we're in a Save block, expand its bounds to cover these bounds too.
381 fSaveStack.top().bounds.join(bounds);
385 // FIXME: this method could use better bounds
386 Bounds bounds
388 Bounds bounds(const DrawPaint&) const { return fCurrentClipBounds; }
389 Bounds bounds(const NoOp&) const { return Bounds::MakeEmpty(); } // NoOps don't draw.
391 Bounds bounds(const DrawRect& op) const { return this->adjustAndMap(op.rect, &op.paint); }
392 Bounds bounds(const DrawOval& op) const { return this->adjustAndMap(op.oval, &op.paint); }
393 Bounds bounds(const DrawRRect& op) const {
396 Bounds bounds(const DrawDRRect& op) const {
399 Bounds bounds(const DrawImage& op) const {
405 Bounds bounds(const DrawImageRect& op) const {
408 Bounds bounds(const DrawImageNine& op) const {
411 Bounds bounds(const DrawBitmapRect& op) const {
414 Bounds bounds(const DrawBitmapRectFast& op) const {
417 Bounds bounds(const DrawBitmapRectFixedSize& op) const {
420 Bounds bounds(const DrawBitmapNine& op) const {
423 Bounds bounds(const DrawBitmap& op) const {
429 Bounds bounds(const DrawPath& op) const {
433 Bounds bounds(const DrawPoints& op) const {
437 // Pad the bounding box a little to make sure hairline points' bounds aren't empty.
443 Bounds bounds(const DrawPatch& op) const {
448 Bounds bounds(const DrawVertices& op) const {
454 Bounds bounds(const DrawAtlas& op) const {
462 Bounds bounds(const DrawPicture& op) const {
468 Bounds bounds(const DrawPosText& op) const {
471 return Bounds::MakeEmpty();
479 Bounds bounds(const DrawPosTextH& op) const {
482 return Bounds::MakeEmpty();
494 Bounds bounds(const DrawTextOnPath& op) const {
510 Bounds bounds(const DrawTextBlob& op) const {
511 SkRect dst = op.blob->bounds();
516 Bounds bounds(const DrawDrawable& op) const {
577 // Conservative identity-space bounds for each op in the SkRecord.
578 Bounds* fBounds;
582 // identity-space bounds of the current clip (fCurrentClipBounds).
585 Bounds fCurrentClipBounds;
587 // Used to track the bounds of Save/Restore blocks and the control ops inside them.
595 CollectLayers(const SkRect& cullRect, const SkRecord& record, SkRect bounds[],
600 , fFillBounds(cullRect, record, bounds)
624 SaveLayerInfo(int opIndex, bool isSaveLayer, const SkRect* bounds, const SkPaint* paint)
628 , fBounds(bounds ? *bounds : SkRect::MakeEmpty())
643 void trackSaveLayers(const SaveLayer& sl) { this->pushSaveLayerInfo(true, sl.bounds, sl.paint); }
666 FillBounds::Bounds newBound = fFillBounds.adjustAndMap(src.fBounds, paint);
727 void pushSaveLayerInfo(bool isSaveLayer, const SkRect* bounds, const SkPaint* paint) {
734 fSaveLayerStack.push(SaveLayerInfo(fFillBounds.currentOp(), isSaveLayer, bounds, paint));
791 void SkRecordFillBounds(const SkRect& cullRect, const SkRecord& record, SkRect bounds[]) {
792 SkRecords::FillBounds visitor(cullRect, record, bounds);
800 void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record, SkRect bounds[],
802 SkRecords::CollectLayers visitor(cullRect, record, bounds, pictList, data);