Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3d8dd3d authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Remove Picture validation

This assert is failing, and not revealing anything interesting. Remove
it.

Bug: skia:7040
Test: Presubmit checks will test this change.
Change-Id: Ib5cae563047096f0f5af8eb58da9287e59d698ba
parent 4c05f548
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ Picture::Picture(const Picture* src) {
        } else if (NULL != src->mRecorder.get()) {
            mPicture = src->makePartialCopy();
        }
        validate();
    } else {
        mWidth = 0;
        mHeight = 0;
@@ -50,18 +49,15 @@ Canvas* Picture::beginRecording(int width, int height) {
void Picture::endRecording() {
    if (NULL != mRecorder.get()) {
        mPicture = mRecorder->finishRecordingAsPicture();
        validate();
        mRecorder.reset(NULL);
    }
}

int Picture::width() const {
    validate();
    return mWidth;
}

int Picture::height() const {
    validate();
    return mHeight;
}

@@ -84,7 +80,6 @@ void Picture::serialize(SkWStream* stream) const {
    if (NULL != mRecorder.get()) {
        this->makePartialCopy()->serialize(stream);
    } else if (NULL != mPicture.get()) {
        validate();
        mPicture->serialize(stream);
    } else {
        // serialize "empty" picture
@@ -99,7 +94,6 @@ void Picture::draw(Canvas* canvas) {
        this->endRecording();
        SkASSERT(NULL != mPicture.get());
    }
    validate();
    if (NULL != mPicture.get()) {
        mPicture->playback(canvas->asSkCanvas());
    }
@@ -115,14 +109,4 @@ sk_sp<SkPicture> Picture::makePartialCopy() const {
    return reRecorder.finishRecordingAsPicture();
}

void Picture::validate() const {
#ifdef SK_DEBUG
    if (NULL != mPicture.get()) {
        SkRect cullRect = mPicture->cullRect();
        SkRect myRect = SkRect::MakeWH(SkIntToScalar(mWidth), SkIntToScalar(mHeight));
        SkASSERT(cullRect == myRect);
    }
#endif
}

}; // namespace android
+0 −2
Original line number Diff line number Diff line
@@ -61,8 +61,6 @@ private:
    // Make a copy of a picture that is in the midst of being recorded. The
    // resulting picture will have balanced saves and restores.
    sk_sp<SkPicture> makePartialCopy() const;

    void validate() const;
};

}; // namespace android