Flutter Engine
txt::ParagraphFixture Class Reference
Inheritance diagram for txt::ParagraphFixture:

Public Member Functions

void SetUp (const benchmark::State &state)
 
void TearDown (const benchmark::State &state)
 

Protected Attributes

std::shared_ptr< FontCollectionfont_collection_
 
std::unique_ptr< SkCanvas > canvas_
 
std::unique_ptr< SkBitmap > bitmap_
 

Detailed Description

Definition at line 39 of file paragraph_benchmarks.cc.

Member Function Documentation

◆ SetUp()

void txt::ParagraphFixture::SetUp ( const benchmark::State &  state)
inline

Definition at line 41 of file paragraph_benchmarks.cc.

References bitmap_, canvas_, font_collection_, and txt::GetTestFontCollection().

41  {
43 
44  bitmap_ = std::make_unique<SkBitmap>();
45  bitmap_->allocN32Pixels(1000, 1000);
46  canvas_ = std::make_unique<SkCanvas>(*bitmap_);
47  canvas_->clear(SK_ColorWHITE);
48  }
std::shared_ptr< FontCollection > GetTestFontCollection()
std::unique_ptr< SkCanvas > canvas_
std::unique_ptr< SkBitmap > bitmap_
std::shared_ptr< FontCollection > font_collection_

◆ TearDown()

void txt::ParagraphFixture::TearDown ( const benchmark::State &  state)
inline

Definition at line 50 of file paragraph_benchmarks.cc.

References font_collection_.

50 { font_collection_.reset(); }
std::shared_ptr< FontCollection > font_collection_

Member Data Documentation

◆ bitmap_

std::unique_ptr<SkBitmap> txt::ParagraphFixture::bitmap_
protected

Definition at line 55 of file paragraph_benchmarks.cc.

Referenced by SetUp().

◆ canvas_

std::unique_ptr<SkCanvas> txt::ParagraphFixture::canvas_
protected

Definition at line 54 of file paragraph_benchmarks.cc.

Referenced by txt::BENCHMARK_F(), and SetUp().

◆ font_collection_

std::shared_ptr<FontCollection> txt::ParagraphFixture::font_collection_
protected

Definition at line 53 of file paragraph_benchmarks.cc.

Referenced by txt::BENCHMARK_DEFINE_F(), txt::BENCHMARK_F(), SetUp(), and TearDown().


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