Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
SrcSrcOverBatchTest.cpp File Reference
#include "include/core/SkAlphaType.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorType.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTypes.h"
#include "include/gpu/GpuTypes.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/GrTypes.h"
#include "include/gpu/ganesh/SkSurfaceGanesh.h"
#include "tests/CtsEnforcement.h"
#include "tests/Test.h"

Go to the source code of this file.

Functions

 DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS (SrcSrcOverBatchTest, reporter, ctxInfo, CtsEnforcement::kNever)
 

Function Documentation

◆ DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS()

DEF_GANESH_TEST_FOR_RENDERING_CONTEXTS ( SrcSrcOverBatchTest  ,
reporter  ,
ctxInfo  ,
CtsEnforcement::kNever   
)

Definition at line 32 of file SrcSrcOverBatchTest.cpp.

35 {
36 auto ctx = ctxInfo.directContext();
37
38 static const int kSize = 8;
41
43 ctx, skgpu::Budgeted::kNo, ii, 0, kTopLeft_GrSurfaceOrigin, nullptr));
44
45 auto canvas = surface->getCanvas();
46
48 // Setting a shader so that we actually build a processor set and don't fallback to all
49 // defaults.
50 paint.setShader(SkShaders::Color(SK_ColorRED));
51
53
54 canvas->drawIRect(rect, paint);
55
56 // Now draw a rect with src blend mode. If we collapsed the previous draw to src blend mode (a
57 // setting on caps plus not having any coverage), then we expect this second draw to try to
58 // batch with it. This test is a success if we don't hit any asserts, specifically making sure
59 // that both things we decided can be batched together claim to have the same value for
60 // CompatibleWithCoverageAsAlpha.
61 canvas->translate(3, 0);
62 paint.setBlendMode(SkBlendMode::kSrc);
63 canvas->drawIRect(rect, paint);
64}
@ kTopLeft_GrSurfaceOrigin
Definition GrTypes.h:148
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition SkAlphaType.h:29
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition SkColorType.h:24
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
static constexpr int kSize
const Paint & paint
VkSurfaceKHR surface
Definition main.cc:49
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350
SK_API sk_sp< SkSurface > RenderTarget(GrRecordingContext *context, skgpu::Budgeted budgeted, const SkImageInfo &imageInfo, int sampleCount, GrSurfaceOrigin surfaceOrigin, const SkSurfaceProps *surfaceProps, bool shouldCreateWithMips=false, bool isProtected=false)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
Definition SkRect.h:56
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)