Flutter Engine
The Flutter Engine
GrShadowGeoProc.h
Go to the documentation of this file.
1/*
2 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef GrShadowGeoProc_DEFINED
9#define GrShadowGeoProc_DEFINED
10
15
16#include <memory>
17
19namespace skgpu { class KeyBuilder; }
20struct GrShaderCaps;
21
22/**
23 * The output color of this effect is a coverage mask for a rrect shadow,
24 * assuming circular corner geometry.
25 */
27public:
28 static GrGeometryProcessor* Make(SkArenaAlloc* arena, const GrSurfaceProxyView& lutView) {
29 return arena->make([&](void* ptr) {
30 return new (ptr) GrRRectShadowGeoProc(lutView);
31 });
32 }
33
34 const char* name() const override { return "RRectShadow"; }
35
36 const Attribute& inPosition() const { return fInPosition; }
37 const Attribute& inColor() const { return fInColor; }
38 const Attribute& inShadowParams() const { return fInShadowParams; }
39 GrColor color() const { return fColor; }
40
41 void addToKey(const GrShaderCaps&, skgpu::KeyBuilder*) const override {}
42
43 std::unique_ptr<ProgramImpl> makeProgramImpl(const GrShaderCaps&) const override;
44
45private:
46 class Impl;
47
49
50 const TextureSampler& onTextureSampler(int i) const override { return fLUTTextureSampler; }
51
52 GrColor fColor;
53 TextureSampler fLUTTextureSampler;
54
55 Attribute fInPosition;
56 Attribute fInColor;
57 Attribute fInShadowParams;
58
60
62};
63
64#endif
uint32_t GrColor
Definition: GrColor.h:25
#define GR_DECLARE_GEOMETRY_PROCESSOR_TEST
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
const Attribute & inShadowParams() const
GrColor color() const
static GrGeometryProcessor * Make(SkArenaAlloc *arena, const GrSurfaceProxyView &lutView)
const Attribute & inColor() const
std::unique_ptr< ProgramImpl > makeProgramImpl(const GrShaderCaps &) const override
void addToKey(const GrShaderCaps &, skgpu::KeyBuilder *) const override
const Attribute & inPosition() const
const char * name() const override
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
Definition: SkArenaAlloc.h:120
Definition: GpuTools.h:21