#include <mock_texture.h>
Definition at line 20 of file mock_texture.h.
◆ MockTexture() [1/2]
| flutter::testing::MockTexture::MockTexture |
( |
int64_t |
textureId, |
|
|
const sk_sp< DlImage > & |
texture = nullptr |
|
) |
| |
|
explicit |
◆ MockTexture() [2/2]
◆ ~MockTexture()
| flutter::testing::MockTexture::~MockTexture |
( |
| ) |
|
|
overridedefault |
◆ frames_available()
| int flutter::testing::MockTexture::frames_available |
( |
| ) |
|
|
inline |
◆ gr_context_created()
| bool flutter::testing::MockTexture::gr_context_created |
( |
| ) |
|
|
inline |
◆ gr_context_destroyed()
| bool flutter::testing::MockTexture::gr_context_destroyed |
( |
| ) |
|
|
inline |
Definition at line 39 of file mock_texture.h.
39{ return gr_context_destroyed_; }
◆ MakeTestTexture()
| sk_sp< DlImage > flutter::testing::MockTexture::MakeTestTexture |
( |
int |
w, |
|
|
int |
h, |
|
|
int |
checker_size |
|
) |
| |
|
static |
Definition at line 12 of file mock_texture.cc.
12 {
14 SkSurfaces::Raster(SkImageInfo::MakeN32Premul(w,
h));
15 SkCanvas* canvas =
surface->getCanvas();
16 SkPaint p0, p1;
17 p0.setStyle(SkPaint::kFill_Style);
18 p0.setColor(SK_ColorGREEN);
19 p1.setStyle(SkPaint::kFill_Style);
20 p1.setColor(SK_ColorBLUE);
21 p1.setAlpha(128);
22 for (
int y = 0;
y < w;
y += checker_size) {
23 for (
int x = 0;
x <
h;
x += checker_size) {
24 SkPaint& cellp = ((
x +
y) & 1) == 0 ? p0 : p1;
25 canvas->drawRect(SkRect::MakeXYWH(
x,
y, checker_size, checker_size),
26 cellp);
27 }
28 }
30}
static sk_sp< DlImage > Make(const SkImage *image)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder h
References flutter::h, flutter::DlImage::Make(), surface, x, and y.
Referenced by flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST_F().
◆ MarkNewFrameAvailable() [1/2]
| void flutter::testing::MockTexture::MarkNewFrameAvailable |
( |
| ) |
|
|
inlineoverridevirtual |
◆ MarkNewFrameAvailable() [2/2]
| void flutter::testing::MockTexture::MarkNewFrameAvailable |
( |
| ) |
|
|
inlineoverridevirtual |
◆ OnGrContextCreated() [1/2]
| void flutter::testing::MockTexture::OnGrContextCreated |
( |
| ) |
|
|
inlineoverridevirtual |
◆ OnGrContextCreated() [2/2]
| void flutter::testing::MockTexture::OnGrContextCreated |
( |
| ) |
|
|
inlineoverridevirtual |
◆ OnGrContextDestroyed() [1/2]
| void flutter::testing::MockTexture::OnGrContextDestroyed |
( |
| ) |
|
|
inlineoverridevirtual |
◆ OnGrContextDestroyed() [2/2]
| void flutter::testing::MockTexture::OnGrContextDestroyed |
( |
| ) |
|
|
inlineoverridevirtual |
◆ OnTextureUnregistered() [1/2]
| void flutter::testing::MockTexture::OnTextureUnregistered |
( |
| ) |
|
|
inlineoverridevirtual |
◆ OnTextureUnregistered() [2/2]
| void flutter::testing::MockTexture::OnTextureUnregistered |
( |
| ) |
|
|
inlineoverridevirtual |
◆ Paint() [1/2]
Implements flutter::Texture.
Definition at line 35 of file mock_texture.cc.
38 {
39
40
43 if (freeze) {
44 FML_DCHECK(src.GetWidth() > 2.0f && src.GetHeight() > 2.0f);
45 src = src.Expand(-1.0f, -1.0f);
46 }
47 context.canvas->DrawImageRect(texture_, src, bounds, sampling, context.paint);
48}
#define FML_DCHECK(condition)
static constexpr std::enable_if_t< std::is_floating_point_v< FT >, TRect > Make(const TRect< U > &rect)
References flutter::Texture::PaintContext::canvas, flutter::DlCanvas::DrawImageRect(), impeller::TRect< T >::Expand(), FML_DCHECK, impeller::TRect< T >::GetHeight(), impeller::TRect< T >::GetWidth(), impeller::TRect< Scalar >::Make(), and flutter::Texture::PaintContext::paint.
◆ Paint() [2/2]
◆ unregistered() [1/2]
| bool flutter::testing::MockTexture::unregistered |
( |
| ) |
|
|
inline |
◆ unregistered() [2/2]
| bool flutter::testing::MockTexture::unregistered |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: