diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /gfx/skia/skia/src/gpu/effects/GrBitmapTextGeoProc.h | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'gfx/skia/skia/src/gpu/effects/GrBitmapTextGeoProc.h')
-rw-r--r-- | gfx/skia/skia/src/gpu/effects/GrBitmapTextGeoProc.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/gfx/skia/skia/src/gpu/effects/GrBitmapTextGeoProc.h b/gfx/skia/skia/src/gpu/effects/GrBitmapTextGeoProc.h new file mode 100644 index 000000000..226ae770e --- /dev/null +++ b/gfx/skia/skia/src/gpu/effects/GrBitmapTextGeoProc.h @@ -0,0 +1,67 @@ +/* + * Copyright 2013 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef GrBitmapTextGeoProc_DEFINED +#define GrBitmapTextGeoProc_DEFINED + +#include "GrProcessor.h" +#include "GrGeometryProcessor.h" + +class GrGLBitmapTextGeoProc; +class GrInvariantOutput; + +/** + * The output color of this effect is a modulation of the input color and a sample from a texture. + * It allows explicit specification of the filtering and wrap modes (GrTextureParams). The input + * coords are a custom attribute. + */ +class GrBitmapTextGeoProc : public GrGeometryProcessor { +public: + static sk_sp<GrGeometryProcessor> Make(GrColor color, GrTexture* tex, const GrTextureParams& p, + GrMaskFormat format, const SkMatrix& localMatrix, + bool usesLocalCoords) { + return sk_sp<GrGeometryProcessor>( + new GrBitmapTextGeoProc(color, tex, p, format, localMatrix, usesLocalCoords)); + } + + virtual ~GrBitmapTextGeoProc() {} + + const char* name() const override { return "Texture"; } + + const Attribute* inPosition() const { return fInPosition; } + const Attribute* inColor() const { return fInColor; } + const Attribute* inTextureCoords() const { return fInTextureCoords; } + GrMaskFormat maskFormat() const { return fMaskFormat; } + GrColor color() const { return fColor; } + bool colorIgnored() const { return GrColor_ILLEGAL == fColor; } + bool hasVertexColor() const { return SkToBool(fInColor); } + const SkMatrix& localMatrix() const { return fLocalMatrix; } + bool usesLocalCoords() const { return fUsesLocalCoords; } + + void getGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override; + + GrGLSLPrimitiveProcessor* createGLSLInstance(const GrGLSLCaps& caps) const override; + +private: + GrBitmapTextGeoProc(GrColor, GrTexture* texture, const GrTextureParams& params, + GrMaskFormat format, const SkMatrix& localMatrix, bool usesLocalCoords); + + GrColor fColor; + SkMatrix fLocalMatrix; + bool fUsesLocalCoords; + GrTextureAccess fTextureAccess; + const Attribute* fInPosition; + const Attribute* fInColor; + const Attribute* fInTextureCoords; + GrMaskFormat fMaskFormat; + + GR_DECLARE_GEOMETRY_PROCESSOR_TEST; + + typedef GrGeometryProcessor INHERITED; +}; + +#endif |