Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
skiagm::TextBlobGeometryChange Class Reference
Inheritance diagram for skiagm::TextBlobGeometryChange:
skiagm::GM

Public Member Functions

 TextBlobGeometryChange ()
 
- Public Member Functions inherited from skiagm::GM
 GM (SkColor backgroundColor=SK_ColorWHITE)
 
virtual ~GM ()
 
void setMode (Mode mode)
 
Mode getMode () const
 
DrawResult gpuSetup (SkCanvas *, SkString *errorMsg, GraphiteTestContext *=nullptr)
 
void gpuTeardown ()
 
void onceBeforeDraw ()
 
DrawResult draw (SkCanvas *canvas)
 
DrawResult draw (SkCanvas *, SkString *errorMsg)
 
void drawBackground (SkCanvas *)
 
DrawResult drawContent (SkCanvas *canvas)
 
DrawResult drawContent (SkCanvas *, SkString *errorMsg)
 
virtual SkISize getISize ()=0
 
virtual SkString getName () const =0
 
virtual bool runAsBench () const
 
SkScalar width ()
 
SkScalar height ()
 
SkColor getBGColor () const
 
void setBGColor (SkColor)
 
void drawSizeBounds (SkCanvas *, SkColor)
 
bool animate (double)
 
virtual bool onChar (SkUnichar)
 
bool getControls (SkMetaData *controls)
 
void setControls (const SkMetaData &controls)
 
virtual void modifyGrContextOptions (GrContextOptions *)
 
virtual void modifyGraphiteContextOptions (skgpu::graphite::ContextOptions *) const
 
virtual bool isBazelOnly () const
 
virtual std::map< std::string, std::string > getGoldKeys () const
 

Protected Member Functions

SkString getName () const override
 
SkISize getISize () override
 
void onDraw (SkCanvas *canvas) override
 
- Protected Member Functions inherited from skiagm::GM
virtual DrawResult onGpuSetup (SkCanvas *, SkString *, GraphiteTestContext *)
 
virtual void onGpuTeardown ()
 
virtual void onOnceBeforeDraw ()
 
virtual DrawResult onDraw (SkCanvas *, SkString *errorMsg)
 
virtual void onDraw (SkCanvas *)
 
virtual bool onAnimate (double)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
GraphiteTestContextgraphiteTestContext () const
 

Additional Inherited Members

- Public Types inherited from skiagm::GM
enum  Mode { kGM_Mode , kSample_Mode , kBench_Mode }
 
using DrawResult = skiagm::DrawResult
 
using GraphiteTestContext = skiatest::graphite::GraphiteTestContext
 
- Static Public Attributes inherited from skiagm::GM
static constexpr char kErrorMsg_DrawSkippedGpuOnly []
 

Detailed Description

Definition at line 28 of file textblobgeometrychange.cpp.

Constructor & Destructor Documentation

◆ TextBlobGeometryChange()

skiagm::TextBlobGeometryChange::TextBlobGeometryChange ( )
inline

Definition at line 30 of file textblobgeometrychange.cpp.

30{ }

Member Function Documentation

◆ getISize()

SkISize skiagm::TextBlobGeometryChange::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 35 of file textblobgeometrychange.cpp.

35{ return SkISize::Make(kWidth, kHeight); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString skiagm::TextBlobGeometryChange::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 33 of file textblobgeometrychange.cpp.

33{ return SkString("textblobgeometrychange"); }

◆ onDraw()

void skiagm::TextBlobGeometryChange::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 37 of file textblobgeometrychange.cpp.

37 {
38 const char text[] = "Hamburgefons";
39
42
44
46
47 sk_sp<SkTextBlob> blob(builder.make());
48
51 auto surface = ToolUtils::makeSurface(canvas, info, &props);
52 SkCanvas* c = surface->getCanvas();
53
54 // LCD text on white background
55 SkRect rect = SkRect::MakeLTRB(0.f, 0.f, SkIntToScalar(kWidth), kHeight / 2.f);
56 SkPaint rectPaint;
57 rectPaint.setColor(0xffffffff);
58 canvas->drawRect(rect, rectPaint);
59 canvas->drawTextBlob(blob, 10, 50, SkPaint());
60
61 // This should not look garbled since we should disable LCD text in this case
62 // (i.e., unknown pixel geometry)
63 c->clear(0x00ffffff);
64 c->drawTextBlob(blob, 10, 150, SkPaint());
65 surface->draw(canvas, 0, 0);
66 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
#define SkIntToScalar(x)
Definition: SkScalar.h:57
@ kUnknown_SkPixelGeometry
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void clear(SkColor color)
Definition: SkCanvas.h:1199
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
Definition: SkCanvas.cpp:2484
Definition: SkFont.h:35
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
void setColor(SkColor color)
Definition: SkPaint.cpp:119
VkSurfaceKHR surface
Definition: main.cc:49
std::u16string text
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
sk_sp< SkTypeface > DefaultPortableTypeface()
sk_sp< SkSurface > makeSurface(SkCanvas *canvas, const SkImageInfo &info, const SkSurfaceProps *props)
Definition: ToolUtils.cpp:512
void add_to_text_blob(SkTextBlobBuilder *builder, const char *text, const SkFont &font, SkScalar x, SkScalar y)
Definition: ToolUtils.cpp:228
font
Font Metadata and Metrics.
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

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