Skip to content

Commit ba8752f

Browse files
egdanielSkia Commit-Bot
authored andcommitted
Remove use of GrColorType as in param in SimpleTextureEffect.fp to just constructor param.
This should also fix a bug in the check generated file housekeeper bot. Change-Id: I70eeb1f8783c760fcba1e81ea79b2734cae54b25 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248856 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
1 parent b7c5bac commit ba8752f

File tree

4 files changed

+8
-47
lines changed

4 files changed

+8
-47
lines changed

src/gpu/effects/GrSimpleTextureEffect.fp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
*/
77

88
in uniform sampler2D image;
9-
in GrColorType srcColorType;
109
in half4x4 matrix;
1110

1211
@constructorParams {
12+
GrColorType srcColorType,
1313
GrSamplerState samplerParams
1414
}
1515

@@ -26,7 +26,7 @@ in half4x4 matrix;
2626
GrColorType srcColorType,
2727
const SkMatrix& matrix) {
2828
return std::unique_ptr<GrFragmentProcessor>(
29-
new GrSimpleTextureEffect(std::move(proxy), srcColorType, matrix,
29+
new GrSimpleTextureEffect(std::move(proxy), matrix, srcColorType,
3030
GrSamplerState(GrSamplerState::WrapMode::kClamp, GrSamplerState::Filter::kNearest)));
3131
}
3232

@@ -36,7 +36,7 @@ in half4x4 matrix;
3636
const SkMatrix& matrix,
3737
GrSamplerState::Filter filter) {
3838
return std::unique_ptr<GrFragmentProcessor>(
39-
new GrSimpleTextureEffect(std::move(proxy), srcColorType, matrix,
39+
new GrSimpleTextureEffect(std::move(proxy), matrix, srcColorType,
4040
GrSamplerState(GrSamplerState::WrapMode::kClamp, filter)));
4141
}
4242

@@ -45,7 +45,7 @@ in half4x4 matrix;
4545
const SkMatrix& matrix,
4646
const GrSamplerState& p) {
4747
return std::unique_ptr<GrFragmentProcessor>(
48-
new GrSimpleTextureEffect(std::move(proxy), srcColorType, matrix, p));
48+
new GrSimpleTextureEffect(std::move(proxy), matrix, srcColorType, p));
4949
}
5050
}
5151

src/gpu/effects/generated/GrSimpleTextureEffect.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class GrGLSLSimpleTextureEffect : public GrGLSLFragmentProcessor {
2323
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
2424
const GrSimpleTextureEffect& _outer = args.fFp.cast<GrSimpleTextureEffect>();
2525
(void)_outer;
26-
auto srcColorType = _outer.srcColorType;
27-
(void)srcColorType;
2826
auto matrix = _outer.matrix;
2927
(void)matrix;
3028
SkString sk_TransformedCoords2D_0 =
@@ -50,15 +48,13 @@ bool GrSimpleTextureEffect::onIsEqual(const GrFragmentProcessor& other) const {
5048
const GrSimpleTextureEffect& that = other.cast<GrSimpleTextureEffect>();
5149
(void)that;
5250
if (image != that.image) return false;
53-
if (srcColorType != that.srcColorType) return false;
5451
if (matrix != that.matrix) return false;
5552
return true;
5653
}
5754
GrSimpleTextureEffect::GrSimpleTextureEffect(const GrSimpleTextureEffect& src)
5855
: INHERITED(kGrSimpleTextureEffect_ClassID, src.optimizationFlags())
5956
, imageCoordTransform(src.imageCoordTransform)
6057
, image(src.image)
61-
, srcColorType(src.srcColorType)
6258
, matrix(src.matrix) {
6359
this->setTextureSamplerCnt(1);
6460
this->addCoordTransform(&imageCoordTransform);

src/gpu/effects/generated/GrSimpleTextureEffect.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class GrSimpleTextureEffect : public GrFragmentProcessor {
2020
GrColorType srcColorType,
2121
const SkMatrix& matrix) {
2222
return std::unique_ptr<GrFragmentProcessor>(
23-
new GrSimpleTextureEffect(std::move(proxy), srcColorType, matrix,
23+
new GrSimpleTextureEffect(std::move(proxy), matrix, srcColorType,
2424
GrSamplerState(GrSamplerState::WrapMode::kClamp,
2525
GrSamplerState::Filter::kNearest)));
2626
}
@@ -31,7 +31,7 @@ class GrSimpleTextureEffect : public GrFragmentProcessor {
3131
const SkMatrix& matrix,
3232
GrSamplerState::Filter filter) {
3333
return std::unique_ptr<GrFragmentProcessor>(new GrSimpleTextureEffect(
34-
std::move(proxy), srcColorType, matrix,
34+
std::move(proxy), matrix, srcColorType,
3535
GrSamplerState(GrSamplerState::WrapMode::kClamp, filter)));
3636
}
3737

@@ -40,18 +40,17 @@ class GrSimpleTextureEffect : public GrFragmentProcessor {
4040
const SkMatrix& matrix,
4141
const GrSamplerState& p) {
4242
return std::unique_ptr<GrFragmentProcessor>(
43-
new GrSimpleTextureEffect(std::move(proxy), srcColorType, matrix, p));
43+
new GrSimpleTextureEffect(std::move(proxy), matrix, srcColorType, p));
4444
}
4545
GrSimpleTextureEffect(const GrSimpleTextureEffect& src);
4646
std::unique_ptr<GrFragmentProcessor> clone() const override;
4747
const char* name() const override { return "SimpleTextureEffect"; }
4848
GrCoordTransform imageCoordTransform;
4949
TextureSampler image;
50-
GrColorType srcColorType;
5150
SkMatrix44 matrix;
5251

5352
private:
54-
GrSimpleTextureEffect(sk_sp<GrTextureProxy> image, GrColorType srcColorType, SkMatrix44 matrix,
53+
GrSimpleTextureEffect(sk_sp<GrTextureProxy> image, SkMatrix44 matrix, GrColorType srcColorType,
5554
GrSamplerState samplerParams)
5655
: INHERITED(kGrSimpleTextureEffect_ClassID,
5756
(OptimizationFlags)ModulateForSamplerOptFlags(
@@ -62,7 +61,6 @@ class GrSimpleTextureEffect : public GrFragmentProcessor {
6261
GrSamplerState::WrapMode::kClampToBorder))
6362
, imageCoordTransform(matrix, image.get())
6463
, image(std::move(image), samplerParams)
65-
, srcColorType(srcColorType)
6664
, matrix(matrix) {
6765
this->setTextureSamplerCnt(1);
6866
this->addCoordTransform(&imageCoordTransform);

src/sksl/sksl_enums.inc

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,4 @@ enum class PMConversion {
3232
kPMConversionCnt = 2
3333
};
3434
35-
enum class GrColorType {
36-
kUnknown,
37-
kAlpha_8,
38-
kBGR_565,
39-
kABGR_4444, // This name differs from SkColorType. kARGB_4444_SkColorType is misnamed.
40-
kRGBA_8888,
41-
kRGBA_8888_SRGB,
42-
kRGB_888x,
43-
kRG_88,
44-
kBGRA_8888,
45-
kRGBA_1010102,
46-
kGray_8,
47-
kAlpha_F16,
48-
kRGBA_F16,
49-
kRGBA_F16_Clamped,
50-
kRGBA_F32,
51-
52-
kAlpha_16,
53-
kRG_1616,
54-
kRG_F16,
55-
kRGBA_16161616,
56-
57-
// Unusual formats that come up after reading back in cases where we are reassigning the meaning
58-
// of a texture format's channels to use for a particular color format but have to read back the
59-
// data to a full RGBA quadruple. (e.g. using a R8 texture format as A8 color type but the API
60-
// only supports reading to RGBA8.) None of these have SkColorType equivalents.
61-
kAlpha_8xxx,
62-
kAlpha_F32xxx,
63-
kGray_8xxx,
64-
65-
kLast = kGray_8xxx
66-
};
67-
6835
)"

0 commit comments

Comments
 (0)