7 #include "flutter/testing/testing.h"
12 #include "third_party/imgui/imgui.h"
13 #include "third_party/skia/include/core/SkData.h"
14 #include "third_party/skia/include/core/SkFontMgr.h"
15 #include "third_party/skia/include/core/SkTypeface.h"
16 #include "txt/platform.h"
42 [&context, &callback](
RenderTarget& render_target) ->
bool {
56 const sk_sp<flutter::DisplayList>& list) {
61 static constexpr
const char* kTestFontFixture =
"Roboto-Regular.ttf";
62 auto mapping = flutter::testing::OpenFixtureAsSkData(kTestFontFixture);
64 sk_sp<SkFontMgr> font_mgr = txt::GetDefaultFontManager();
65 return SkFont{font_mgr->makeFromData(mapping), scalar};
73 const char* fixture_name,
74 bool enable_mipmapping)
const {
75 std::shared_ptr<fml::Mapping> mapping =
76 flutter::testing::OpenFixtureAsMapping(fixture_name);
80 texture->SetLabel(fixture_name);
ContentContext & GetContentContext() const
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
SkFont CreateTestFontOfSize(Scalar scalar)
bool OpenPlaygroundHere(flutter::DisplayListBuilder &builder)
std::unique_ptr< testing::Screenshot > MakeScreenshot(const sk_sp< flutter::DisplayList > &list)
sk_sp< flutter::DlImage > CreateDlImageForFixture(const char *fixture_name, bool enable_mipmapping=false) const
std::function< sk_sp< flutter::DisplayList >()> DisplayListPlaygroundCallback
bool OpenPlaygroundHere(const RenderCallback &render_callback)
const PlaygroundSwitches switches_
std::shared_ptr< Context > GetContext() const
static std::shared_ptr< Texture > CreateTextureForMapping(const std::shared_ptr< Context > &context, std::shared_ptr< fml::Mapping > mapping, bool enable_mipmapping=false)
ISize GetRenderTargetSize() const
static std::shared_ptr< TypographerContext > Make()
bool RenderToTarget(ContentContext &context, RenderTarget render_target, const sk_sp< flutter::DisplayList > &display_list, Rect cull_rect, bool reset_host_buffer, bool is_onscreen)
Render the provided display list to the render target.
constexpr static TRect MakeWH(Type width, Type height)