Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: gm/yuvtorgbeffect.cpp

Issue 516463005: Add support for the Rec601 YUV color space to GrYUVtoRGBEffect. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move enum to SkImageInfo Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkImageGenerator.h » ('j') | include/core/SkImageGenerator.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | include/core/SkImageGenerator.h » ('j') | include/core/SkImageGenerator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698