Index: gm/yuvtorgbeffect.cpp |
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp |
index 12676f262e2477f72cd3a19487ea2b7400e3a0fd..acb6f2251b7ecc51b9d35c20402e8d4aafcbc147 100644 |
--- a/gm/yuvtorgbeffect.cpp |
+++ b/gm/yuvtorgbeffect.cpp |
@@ -35,7 +35,7 @@ protected: |
} |
virtual SkISize onISize() SK_OVERRIDE { |
- return SkISize::Make(334, 64); |
+ return SkISize::Make(334, 128); |
} |
virtual uint32_t onGetFlags() const SK_OVERRIDE { |
@@ -93,31 +93,36 @@ protected: |
static const SkScalar kDrawPad = 10.f; |
static const SkScalar kTestPad = 10.f; |
- |
- SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp[0].width()), |
- SkIntToScalar(fBmp[0].height())); |
- renderRect.outset(kDrawPad, kDrawPad); |
- |
- SkScalar y = kDrawPad + kTestPad; |
- SkScalar x = kDrawPad + kTestPad; |
- |
- const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; |
- |
- for (int i = 0; i < 6; ++i) { |
- SkAutoTUnref<GrEffect> effect( |
- GrYUVtoRGBEffect::Create(texture[indices[i][0]], |
- texture[indices[i][1]], |
- texture[indices[i][2]])); |
- if (effect) { |
- SkMatrix viewMatrix; |
- viewMatrix.setTranslate(x, y); |
- drawState->reset(viewMatrix); |
- drawState->setRenderTarget(rt); |
- drawState->setColor(0xffffffff); |
- drawState->addColorEffect(effect, 1); |
- tt.target()->drawSimpleRect(renderRect); |
- } |
- x += renderRect.width() + kTestPad; |
+ static const SkScalar kColorSpaceOffset = 64.f; |
+ |
+ for (int space = kJPEG_SkYUVColorSpace; space <= kLastEnum_SkYUVColorSpace; |
+ ++space) { |
+ SkRect renderRect = SkRect::MakeWH(SkIntToScalar(fBmp[0].width()), |
+ SkIntToScalar(fBmp[0].height())); |
+ renderRect.outset(kDrawPad, kDrawPad); |
+ |
+ SkScalar y = kDrawPad + kTestPad + space * kColorSpaceOffset; |
+ SkScalar x = kDrawPad + kTestPad; |
+ |
+ const int indices[6][3] = {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}; |
+ |
+ for (int i = 0; i < 6; ++i) { |
+ SkAutoTUnref<GrEffect> effect( |
+ GrYUVtoRGBEffect::Create(texture[indices[i][0]], |
+ texture[indices[i][1]], |
+ texture[indices[i][2]], |
+ static_cast<SkYUVColorSpace>(space))); |
+ if (effect) { |
+ SkMatrix viewMatrix; |
+ viewMatrix.setTranslate(x, y); |
+ drawState->reset(viewMatrix); |
+ drawState->setRenderTarget(rt); |
+ drawState->setColor(0xffffffff); |
+ drawState->addColorEffect(effect, 1); |
+ tt.target()->drawSimpleRect(renderRect); |
+ } |
+ x += renderRect.width() + kTestPad; |
+ } |
} |
GrUnlockAndUnrefCachedBitmapTexture(texture[0]); |