コード例 #1
0
ファイル: SkRecordDraw.cpp プロジェクト: alphan102/gecko-dev
    // Adjust rect for all paints that may affect its geometry, then map it to identity space.
    Bounds adjustAndMap(SkRect rect, const SkPaint* paint) const {
        // Inverted rectangles really confuse our BBHs.
        rect.sort();

        // Adjust the rect for its own paint.
        if (!AdjustForPaint(paint, &rect)) {
            // The paint could do anything to our bounds.  The only safe answer is the current clip.
            return fCurrentClipBounds;
        }

        // Adjust rect for all the paints from the SaveLayers we're inside.
        if (!this->adjustForSaveLayerPaints(&rect)) {
            // Same deal as above.
            return fCurrentClipBounds;
        }

        // Map the rect back to identity space.
        fCTM.mapRect(&rect);

        // Nothing can draw outside the current clip.
        if (!rect.intersect(fCurrentClipBounds)) {
            return Bounds::MakeEmpty();
        }

        return rect;
    }
コード例 #2
0
ファイル: GrPictureUtils.cpp プロジェクト: DXGL/skia
 bool adjustForSaveLayerPaints(SkRect* rect, int savesToIgnore = 0) const {
     for (int i = fSaveStack.count() - 1 - savesToIgnore; i >= 0; i--) {
         if (!AdjustForPaint(fSaveStack[i].paint, rect)) {
             return false;
         }
     }
     return true;
 }
コード例 #3
0
ファイル: SkRecordDraw.cpp プロジェクト: alphan102/gecko-dev
 bool adjustForSaveLayerPaints(SkRect* rect, int savesToIgnore = 0) const {
     for (int i = fSaveStack.count() - 1 - savesToIgnore; i >= 0; i--) {
         SkMatrix inverse;
         if (!fSaveStack[i].ctm.invert(&inverse)) {
             return false;
         }
         inverse.mapRect(rect);
         if (!AdjustForPaint(fSaveStack[i].paint, rect)) {
             return false;
         }
         fSaveStack[i].ctm.mapRect(rect);
     }
     return true;
 }
コード例 #4
0
ファイル: GrPictureUtils.cpp プロジェクト: DXGL/skia
    // Adjust rect for all paints that may affect its geometry, then map it to identity space.
    Bounds adjustAndMap(SkRect rect, const SkPaint* paint) const {
        // Inverted rectangles really confuse our BBHs.
        rect.sort();

        // Adjust the rect for its own paint.
        if (!AdjustForPaint(paint, &rect)) {
            // The paint could do anything to our bounds.  The only safe answer is the current clip.
            return fCurrentClipBounds;
        }

        // Adjust rect for all the paints from the SaveLayers we're inside.
        if (!this->adjustForSaveLayerPaints(&rect)) {
            // Same deal as above.
            return fCurrentClipBounds;
        }

        // Map the rect back to identity space.
        fCTM->mapRect(&rect);

        // Nothing can draw outside the current clip.
        // (Only bounded ops call into this method, so oddballs like Clear don't matter here.)
        rect.intersect(fCurrentClipBounds);
        return rect;
    }