Flutter Engine
The Flutter Engine
Functions | Variables
IndexedPngOverflowTest.cpp File Reference
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkSurface.h"
#include "tests/CodecPriv.h"
#include "tests/Test.h"

Go to the source code of this file.

Functions

 DEF_TEST (IndexedPngOverflow, reporter)
 

Variables

unsigned char gPng []
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( IndexedPngOverflow  ,
reporter   
)

Definition at line 32 of file IndexedPngOverflowTest.cpp.

32 {
33 SkBitmap bm;
34 bool success = decode_memory(gPng, sizeof(gPng), &bm);
35 REPORTER_ASSERT(reporter, success);
36
38 ->getCanvas()
39 ->drawImage(bm.asImage(), 0, 0);
40}
bool decode_memory(const void *mem, size_t size, SkBitmap *bm)
Definition: CodecPriv.h:21
reporter
Definition: FontMgrTest.cpp:39
unsigned char gPng[]
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
sk_sp< SkImage > asImage() const
Definition: SkBitmap.cpp:645
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
SkCanvas * getCanvas()
Definition: SkSurface.cpp:82
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)

Variable Documentation

◆ gPng

unsigned char gPng[]
Initial value:
= {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01,
0x08, 0x03, 0x00, 0x00, 0x00, 0xe9, 0x4c, 0x7e, 0x17, 0x00, 0x00, 0x00,
0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x1c, 0x00, 0x0f, 0x01, 0xb9, 0x8f, 0x00, 0x00, 0x00, 0x06, 0x50, 0x4c,
0x54, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa5, 0x67, 0xb9, 0xcf,
0x00, 0x00, 0x00, 0x20, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0xfd,
0x07, 0x01, 0x00, 0x20, 0x08, 0x00, 0x41, 0xbc, 0x5b, 0xe8, 0xdf, 0x97,
0x99, 0xe3, 0x92, 0xa0, 0xf2, 0xdf, 0x3d, 0x7b, 0x0d, 0xda, 0x04, 0x1c,
0x03, 0xad, 0x00, 0x38, 0x5c, 0x2e, 0xad, 0x12, 0x00, 0x00, 0x00, 0x00,
0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
}

Definition at line 18 of file IndexedPngOverflowTest.cpp.