1cb93a386Sopenharmony_ci/*
2cb93a386Sopenharmony_ci * Copyright 2019 Google LLC
3cb93a386Sopenharmony_ci *
4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be
5cb93a386Sopenharmony_ci * found in the LICENSE file.
6cb93a386Sopenharmony_ci */
7cb93a386Sopenharmony_ci
8cb93a386Sopenharmony_ci#ifndef TestRectOp_DEFINED
9cb93a386Sopenharmony_ci#define TestRectOp_DEFINED
10cb93a386Sopenharmony_ci
11cb93a386Sopenharmony_ci#include "include/core/SkRefCnt.h"
12cb93a386Sopenharmony_ci#include "include/gpu/GrRecordingContext.h"
13cb93a386Sopenharmony_ci#include "src/gpu/GrRecordingContextPriv.h"
14cb93a386Sopenharmony_ci#include "src/gpu/ops/GrOp.h"
15cb93a386Sopenharmony_ci
16cb93a386Sopenharmony_ciclass GrPaint;
17cb93a386Sopenharmony_ci
18cb93a386Sopenharmony_cinamespace sk_gpu_test::test_ops {
19cb93a386Sopenharmony_ci
20cb93a386Sopenharmony_ci/**
21cb93a386Sopenharmony_ci * Fully specified device space rect op. The test Op draws a rectangle with local coords and a
22cb93a386Sopenharmony_ci * local matrix. It is important to test effects in the presence of GP local matrices. Our standard
23cb93a386Sopenharmony_ci * rect drawing code doesn't exercise this because it applies any local matrix to pre-transformed
24cb93a386Sopenharmony_ci * local coord vertex attributes.
25cb93a386Sopenharmony_ci */
26cb93a386Sopenharmony_ciGrOp::Owner MakeRect(GrRecordingContext*,
27cb93a386Sopenharmony_ci                     GrPaint&&,
28cb93a386Sopenharmony_ci                     const SkRect& drawRect,
29cb93a386Sopenharmony_ci                     const SkRect& localRect,
30cb93a386Sopenharmony_ci                     const SkMatrix& localM = SkMatrix::I());
31cb93a386Sopenharmony_ci
32cb93a386Sopenharmony_ci/**
33cb93a386Sopenharmony_ci * A simpler version of MakeRect that takes a single color FP instead of a full paint. Uses
34cb93a386Sopenharmony_ci * SkBlendMode::kSrcOver.
35cb93a386Sopenharmony_ci */
36cb93a386Sopenharmony_ciGrOp::Owner MakeRect(GrRecordingContext*,
37cb93a386Sopenharmony_ci                     std::unique_ptr<GrFragmentProcessor>,
38cb93a386Sopenharmony_ci                     const SkRect& drawRect,
39cb93a386Sopenharmony_ci                     const SkRect& localRect,
40cb93a386Sopenharmony_ci                     const SkMatrix& localM = SkMatrix::I());
41cb93a386Sopenharmony_ci
42cb93a386Sopenharmony_ci/**
43cb93a386Sopenharmony_ci * A simpler version of MakeRect that uses the same rect as the device space rect to draw as well as
44cb93a386Sopenharmony_ci * the local rect. The local matrix is identity.
45cb93a386Sopenharmony_ci */
46cb93a386Sopenharmony_ciGrOp::Owner MakeRect(GrRecordingContext*, GrPaint&&, const SkRect& rect);
47cb93a386Sopenharmony_ci
48cb93a386Sopenharmony_ci}  // namespace sk_gpu_test::test_ops
49cb93a386Sopenharmony_ci
50cb93a386Sopenharmony_ci#endif
51