Flutter Engine
The Flutter Engine
SkEncoder.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2023 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
11
12bool SkEncoder::encodeRows(int numRows) {
13 SkASSERT(numRows > 0 && fCurrRow < fSrc.height());
14 if (numRows <= 0 || fCurrRow >= fSrc.height()) {
15 return false;
16 }
17
18 if (fCurrRow + numRows > fSrc.height()) {
19 numRows = fSrc.height() - fCurrRow;
20 }
21
22 if (!this->onEncodeRows(numRows)) {
23 // If we fail, short circuit any future calls.
25 return false;
26 }
27
28 return true;
29}
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool encodeRows(int numRows)
Definition: SkEncoder.cpp:12
virtual bool onEncodeRows(int numRows)=0
int fCurrRow
Definition: SkEncoder.h:59
const SkPixmap & fSrc
Definition: SkEncoder.h:58
int height() const
Definition: SkPixmap.h:166