Flutter Engine
The Flutter Engine
third_party
skia
src
encode
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
8
#include "
include/encode/SkEncoder.h
"
9
10
#include "
include/private/base/SkAssert.h
"
11
12
bool
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.
24
fCurrRow
=
fSrc
.
height
();
25
return
false
;
26
}
27
28
return
true
;
29
}
SkAssert.h
SkASSERT
#define SkASSERT(cond)
Definition:
SkAssert.h:116
SkEncoder.h
SkEncoder::encodeRows
bool encodeRows(int numRows)
Definition:
SkEncoder.cpp:12
SkEncoder::onEncodeRows
virtual bool onEncodeRows(int numRows)=0
SkEncoder::fCurrRow
int fCurrRow
Definition:
SkEncoder.h:59
SkEncoder::fSrc
const SkPixmap & fSrc
Definition:
SkEncoder.h:58
SkPixmap::height
int height() const
Definition:
SkPixmap.h:166
Generated on Sun Jun 23 2024 21:56:16 for Flutter Engine by
1.9.4