5#ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_DECODER_NO_GL_UNITTESTS_H_
6#define FLUTTER_LIB_UI_PAINTING_IMAGE_DECODER_NO_GL_UNITTESTS_H_
10#include "flutter/impeller/core/allocator.h"
11#include "flutter/impeller/core/device_buffer.h"
12#include "flutter/impeller/core/formats.h"
13#include "flutter/impeller/geometry/size.h"
14#include "flutter/lib/ui/painting/image_decoder.h"
15#include "flutter/lib/ui/painting/image_decoder_impeller.h"
16#include "flutter/testing/testing.h"
24 void SetLabel(std::string_view label)
override {}
25 bool IsValid()
const override {
return true; }
41 bytes_ =
static_cast<uint8_t*
>(malloc(desc.size));
49 uint16_t row_bytes)
const override {
53 bool SetLabel(
const std::string& label)
override {
return true; }
55 bool SetLabel(
const std::string& label,
Range range)
override {
return true; }
81 return ISize{2048, 2048};
86 return std::make_shared<TestImpellerDeviceBuffer>(desc);
91 return std::make_shared<TestImpellerTexture>(desc);
An object that allocates device memory.
std::shared_ptr< Texture > OnCreateTexture(const TextureDescriptor &desc) override
ISize GetMaxTextureSizeSupported() const override
~TestImpellerAllocator()=default
uint16_t MinimumBytesPerRow(PixelFormat format) const override
Minimum value for row_bytes on a Texture. The row bytes parameter of that method must be aligned to t...
std::shared_ptr< DeviceBuffer > OnCreateBuffer(const DeviceBufferDescriptor &desc) override
TestImpellerDeviceBuffer(DeviceBufferDescriptor desc)
std::shared_ptr< Texture > AsTexture(Allocator &allocator, const TextureDescriptor &descriptor, uint16_t row_bytes) const override
~TestImpellerDeviceBuffer()
bool SetLabel(const std::string &label, Range range) override
bool SetLabel(const std::string &label) override
bool OnCopyHostBuffer(const uint8_t *source, Range source_range, size_t offset) override
uint8_t * OnGetContents() const override
bool OnSetContents(const uint8_t *contents, size_t length, size_t slice)
bool OnSetContents(std::shared_ptr< const fml::Mapping > mapping, size_t slice)
bool IsValid() const override
void SetLabel(std::string_view label) override
TestImpellerTexture(TextureDescriptor desc)
const TextureDescriptor & GetTextureDescriptor() const
uint32_t uint32_t * format
float DecodeBGR10(uint32_t x)
float HalfToFloat(uint16_t half)
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...