5#include "flutter/flow/testing/mock_texture.h"
7#include "flutter/display_list/dl_builder.h"
8#include "flutter/testing/display_list_testing.h"
9#include "gtest/gtest.h"
14TEST(MockTextureTest, Callbacks) {
15 auto texture = std::make_shared<MockTexture>(0);
17 ASSERT_FALSE(
texture->gr_context_created());
19 ASSERT_TRUE(
texture->gr_context_created());
21 ASSERT_FALSE(
texture->gr_context_destroyed());
22 texture->OnGrContextDestroyed();
23 ASSERT_TRUE(
texture->gr_context_destroyed());
25 ASSERT_FALSE(
texture->unregistered());
26 texture->OnTextureUnregistered();
27 ASSERT_TRUE(
texture->unregistered());
30TEST(MockTextureTest, PaintCalls) {
36 auto texture = std::make_shared<MockTexture>(0, texture_image);
54TEST(MockTextureTest, PaintCallsWithLinearSampling) {
60 auto texture = std::make_shared<MockTexture>(0, texture_image);
sk_sp< DisplayList > Build()
void DrawImageRect(const sk_sp< DlImage > &image, const SkRect &src, const SkRect &dst, DlImageSampling sampling, const DlPaint *paint=nullptr, SrcRectConstraint constraint=SrcRectConstraint::kFast) override
static sk_sp< DlImage > MakeTestTexture(int w, int h, int checker_size)
SkSamplingOptions sampling
bool DisplayListsEQ_Verbose(const DisplayList *a, const DisplayList *b)
TEST(DisplayListComplexity, EmptyDisplayList)
static SkRect Make(const SkISize &size)
SkRect makeInset(float dx, float dy) const
static constexpr SkRect MakeWH(float w, float h)
#define EXPECT_TRUE(handle)