Flutter Engine
The Flutter Engine
Classes | Functions
BlitMaskClip.cpp File Reference
#include "include/core/SkColor.h"
#include "include/core/SkRect.h"
#include "include/core/SkTypes.h"
#include "src/core/SkBlitter.h"
#include "src/core/SkMask.h"
#include "tests/Test.h"
#include <cstdint>
#include <cstring>

Go to the source code of this file.

Classes

class  TestBlitter
 

Functions

 DEF_TEST (BlitAndClip, reporter)
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( BlitAndClip  ,
reporter   
)

Definition at line 43 of file BlitMaskClip.cpp.

43 {
44 const int originX = 100;
45 const int originY = 100;
46 for (int width = 1; width <= 32; width++) {
47 const int height = 2;
48 int rowBytes = (width + 7) >> 3;
49 uint8_t* bits = new uint8_t[rowBytes * height];
50 memset(bits, 0xAA, rowBytes * height);
51
52 SkIRect b = {originX, originY, originX + width, originY + height};
53 SkMask mask(bits, b, rowBytes, SkMask::kBW_Format);
54 TestBlitter tb(mask.fBounds, reporter);
55
56 for (int top = b.fTop; top < b.fBottom; top++) {
57 for (int bottom = top + 1; bottom <= b.fBottom; bottom++) {
58 for (int left = b.fLeft; left < b.fRight; left++) {
59 for (int right = left + 1; right <= b.fRight; right++) {
60 SkIRect clipRect = {left, top, right, bottom};
61 tb.blitMask(mask, clipRect);
62 }
63 }
64 }
65 }
66
67 delete [] bits;
68 }
69}
reporter
Definition: FontMgrTest.cpp:39
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
static bool b
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
int32_t height
int32_t width
Definition: SkRect.h:32
Definition: SkMask.h:25
@ kBW_Format
1bit per pixel mask (e.g. monochrome)
Definition: SkMask.h:27