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

Commit 9d12dde2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove Picture validation"

parents 4c58a1b8 e3d8dd3d
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