2019-11-22 21:56:36 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2019 Google LLC
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TestRectOp_DEFINED
|
|
|
|
#define TestRectOp_DEFINED
|
|
|
|
|
|
|
|
#include "include/core/SkRefCnt.h"
|
2020-07-01 16:55:01 +00:00
|
|
|
#include "include/gpu/GrRecordingContext.h"
|
2022-04-07 15:20:24 +00:00
|
|
|
#include "src/gpu/ganesh/GrRecordingContextPriv.h"
|
|
|
|
#include "src/gpu/ganesh/ops/GrOp.h"
|
2019-11-22 21:56:36 +00:00
|
|
|
|
|
|
|
class GrPaint;
|
|
|
|
|
|
|
|
namespace sk_gpu_test::test_ops {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fully specified device space rect op. The test Op draws a rectangle with local coords and a
|
|
|
|
* local matrix. It is important to test effects in the presence of GP local matrices. Our standard
|
|
|
|
* rect drawing code doesn't exercise this because it applies any local matrix to pre-transformed
|
|
|
|
* local coord vertex attributes.
|
|
|
|
*/
|
2020-10-07 20:46:15 +00:00
|
|
|
GrOp::Owner MakeRect(GrRecordingContext*,
|
|
|
|
GrPaint&&,
|
|
|
|
const SkRect& drawRect,
|
|
|
|
const SkRect& localRect,
|
|
|
|
const SkMatrix& localM = SkMatrix::I());
|
2019-11-22 21:56:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A simpler version of MakeRect that takes a single color FP instead of a full paint. Uses
|
|
|
|
* SkBlendMode::kSrcOver.
|
|
|
|
*/
|
2020-10-07 20:46:15 +00:00
|
|
|
GrOp::Owner MakeRect(GrRecordingContext*,
|
|
|
|
std::unique_ptr<GrFragmentProcessor>,
|
|
|
|
const SkRect& drawRect,
|
|
|
|
const SkRect& localRect,
|
|
|
|
const SkMatrix& localM = SkMatrix::I());
|
2019-11-22 21:56:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A simpler version of MakeRect that uses the same rect as the device space rect to draw as well as
|
|
|
|
* the local rect. The local matrix is identity.
|
|
|
|
*/
|
2020-10-07 20:46:15 +00:00
|
|
|
GrOp::Owner MakeRect(GrRecordingContext*, GrPaint&&, const SkRect& rect);
|
2019-11-22 21:56:36 +00:00
|
|
|
|
|
|
|
} // namespace sk_gpu_test::test_ops
|
|
|
|
|
|
|
|
#endif
|