Flutter Engine
flutter::testing::MockTexture Class Reference

#include <mock_texture.h>

Inheritance diagram for flutter::testing::MockTexture:
flutter::Texture flutter::Texture

Classes

struct  PaintCall
 

Public Member Functions

 MockTexture (int64_t textureId)
 
void Paint (SkCanvas &canvas, const SkRect &bounds, bool freeze, GrDirectContext *context, SkFilterQuality filter_quality) override
 
void OnGrContextCreated () override
 
void OnGrContextDestroyed () override
 
void MarkNewFrameAvailable () override
 
void OnTextureUnregistered () override
 
const std::vector< PaintCall > & paint_calls ()
 
bool gr_context_created ()
 
bool gr_context_destroyed ()
 
bool unregistered ()
 
 MockTexture (int64_t textureId, std::shared_ptr< fml::AutoResetWaitableEvent > latch)
 
 ~MockTexture () override=default
 
void Paint (SkCanvas &canvas, const SkRect &bounds, bool freeze, GrDirectContext *context, SkFilterQuality filter_quality) override
 
void OnGrContextCreated () override
 
void OnGrContextDestroyed () override
 
void MarkNewFrameAvailable () override
 
void OnTextureUnregistered () override
 
bool unregistered ()
 
int frames_available ()
 
- Public Member Functions inherited from flutter::Texture
 Texture (int64_t id)
 
virtual ~Texture ()
 
int64_t Id ()
 

Detailed Description

Definition at line 17 of file mock_texture.h.

Constructor & Destructor Documentation

◆ MockTexture() [1/2]

flutter::testing::MockTexture::MockTexture ( int64_t  textureId)
explicit

Definition at line 10 of file mock_texture.cc.

10 : Texture(textureId) {}
Texture(int64_t id)
Definition: texture.cc:9

◆ MockTexture() [2/2]

flutter::testing::MockTexture::MockTexture ( int64_t  textureId,
std::shared_ptr< fml::AutoResetWaitableEvent latch 
)
inline

Definition at line 1503 of file shell_unittests.cc.

References ~MockTexture().

1505  : Texture(textureId), latch_(latch) {}
Texture(int64_t id)
Definition: texture.cc:9

◆ ~MockTexture()

flutter::testing::MockTexture::~MockTexture ( )
overridedefault

Referenced by MockTexture().

Member Function Documentation

◆ frames_available()

int flutter::testing::MockTexture::frames_available ( )
inline

Definition at line 1531 of file shell_unittests.cc.

1531 { return frames_available_; }

◆ gr_context_created()

bool flutter::testing::MockTexture::gr_context_created ( )
inline

Definition at line 42 of file mock_texture.h.

42 { return gr_context_created_; }

◆ gr_context_destroyed()

bool flutter::testing::MockTexture::gr_context_destroyed ( )
inline

Definition at line 43 of file mock_texture.h.

43 { return gr_context_destroyed_; }

◆ MarkNewFrameAvailable() [1/2]

void flutter::testing::MockTexture::MarkNewFrameAvailable ( )
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 38 of file mock_texture.h.

38 {}

◆ MarkNewFrameAvailable() [2/2]

void flutter::testing::MockTexture::MarkNewFrameAvailable ( )
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 1520 of file shell_unittests.cc.

1520  {
1521  frames_available_++;
1522  latch_->Signal();
1523  }

◆ OnGrContextCreated() [1/2]

void flutter::testing::MockTexture::OnGrContextCreated ( )
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 36 of file mock_texture.h.

36 { gr_context_created_ = true; }

◆ OnGrContextCreated() [2/2]

void flutter::testing::MockTexture::OnGrContextCreated ( )
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 1516 of file shell_unittests.cc.

1516 {}

◆ OnGrContextDestroyed() [1/2]

void flutter::testing::MockTexture::OnGrContextDestroyed ( )
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 37 of file mock_texture.h.

37 { gr_context_destroyed_ = true; }

◆ OnGrContextDestroyed() [2/2]

void flutter::testing::MockTexture::OnGrContextDestroyed ( )
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 1518 of file shell_unittests.cc.

1518 {}

◆ OnTextureUnregistered() [1/2]

void flutter::testing::MockTexture::OnTextureUnregistered ( )
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 39 of file mock_texture.h.

39 { unregistered_ = true; }

◆ OnTextureUnregistered() [2/2]

void flutter::testing::MockTexture::OnTextureUnregistered ( )
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 1525 of file shell_unittests.cc.

1525  {
1526  unregistered_ = true;
1527  latch_->Signal();
1528  }

◆ Paint() [1/2]

void flutter::testing::MockTexture::Paint ( SkCanvas &  canvas,
const SkRect &  bounds,
bool  freeze,
GrDirectContext *  context,
SkFilterQuality  filter_quality 
)
overridevirtual

Implements flutter::Texture.

Definition at line 12 of file mock_texture.cc.

16  {
17  paint_calls_.emplace_back(
18  PaintCall{canvas, bounds, freeze, context, filter_quality});
19 }

◆ Paint() [2/2]

void flutter::testing::MockTexture::Paint ( SkCanvas &  canvas,
const SkRect &  bounds,
bool  freeze,
GrDirectContext *  context,
SkFilterQuality  filter_quality 
)
inlineoverridevirtual

Implements flutter::Texture.

Definition at line 1510 of file shell_unittests.cc.

1514  {}

◆ paint_calls()

const std::vector<PaintCall>& flutter::testing::MockTexture::paint_calls ( )
inline

Definition at line 41 of file mock_texture.h.

41 { return paint_calls_; }

◆ unregistered() [1/2]

bool flutter::testing::MockTexture::unregistered ( )
inline

Definition at line 44 of file mock_texture.h.

References flutter::testing::operator<<(), and flutter::testing::operator==().

44 { return unregistered_; }

◆ unregistered() [2/2]

bool flutter::testing::MockTexture::unregistered ( )
inline

Definition at line 1530 of file shell_unittests.cc.

1530 { return unregistered_; }

The documentation for this class was generated from the following files: