Index: gm/yuvtorgbeffect.cpp |
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp |
index 12676f262e2477f72cd3a19487ea2b7400e3a0fd..056f87f6dce6148700f07e968d2e43ce6985b26f 100644 |
--- a/gm/yuvtorgbeffect.cpp |
+++ b/gm/yuvtorgbeffect.cpp |
@@ -25,13 +25,23 @@ namespace skiagm { |
*/ |
class YUVtoRGBEffect : public GM { |
public: |
- YUVtoRGBEffect() { |
+ YUVtoRGBEffect(SkYUVColorSpace colorSpace) |
+ : fColorSpace(colorSpace) { |
this->setBGColor(0xFFFFFFFF); |
} |
protected: |
virtual SkString onShortName() SK_OVERRIDE { |
- return SkString("yuv_to_rgb_effect"); |
+ SkString out("yuv_to_rgb_effect_"); |
+ switch(fColorSpace) { |
+ case kJPEG_SkYUVColorSpace: |
+ out.append("jpeg"); |
+ break; |
+ case kRec601_SkYUVColorSpace: |
+ out.append("rec601"); |
+ break; |
+ } |
+ return out; |
} |
virtual SkISize onISize() SK_OVERRIDE { |
@@ -107,7 +117,8 @@ protected: |
SkAutoTUnref<GrEffect> effect( |
GrYUVtoRGBEffect::Create(texture[indices[i][0]], |
texture[indices[i][1]], |
- texture[indices[i][2]])); |
+ texture[indices[i][2]], |
+ kJPEG_SkYUVColorSpace)); |
if (effect) { |
SkMatrix viewMatrix; |
viewMatrix.setTranslate(x, y); |
@@ -127,11 +138,13 @@ protected: |
private: |
SkBitmap fBmp[3]; |
+ SkYUVColorSpace fColorSpace; |
typedef GM INHERITED; |
}; |
-DEF_GM( return SkNEW(YUVtoRGBEffect); ) |
+DEF_GM( return SkNEW_ARGS(YUVtoRGBEffect, (kJPEG_SkYUVColorSpace)); ) |
bsalomon
2014/09/11 20:17:17
Is it possible to make the existing GM draw twice?
rileya (GONE FROM CHROMIUM)
2014/09/11 20:43:40
Done. Is the rebasing process described here still
bsalomon
2014/09/12 00:19:04
Yup, you'll want to add the test name to expectati
|
+DEF_GM( return SkNEW_ARGS(YUVtoRGBEffect, (kRec601_SkYUVColorSpace)); ) |
} |
#endif |