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

Unified Diff: gm/yuvtorgbeffect.cpp

Issue 922273002: YUV scale fix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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 | src/gpu/SkGr.cpp » ('j') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('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 fb0c67d3d10240f59bd140690160470d726360fc..68abcf64b6f26f5e947648141ac143e0c91efd5b 100644
--- a/gm/yuvtorgbeffect.cpp
+++ b/gm/yuvtorgbeffect.cpp
@@ -19,6 +19,8 @@
#include "SkGr.h"
#include "SkGradientShader.h"
+#define IMAGE_SIZE 24
+
namespace skiagm {
/**
* This GM directly exercises GrYUVtoRGBEffect.
@@ -39,7 +41,7 @@ protected:
}
void onOnceBeforeDraw() SK_OVERRIDE {
- SkImageInfo info = SkImageInfo::MakeA8(24, 24);
+ SkImageInfo info = SkImageInfo::MakeA8(IMAGE_SIZE, IMAGE_SIZE);
fBmp[0].allocPixels(info);
fBmp[1].allocPixels(info);
fBmp[2].allocPixels(info);
@@ -89,6 +91,9 @@ protected:
static const SkScalar kDrawPad = 10.f;
static const SkScalar kTestPad = 10.f;
static const SkScalar kColorSpaceOffset = 64.f;
+ SkISize sizes[3] = {{IMAGE_SIZE, IMAGE_SIZE},
+ {IMAGE_SIZE, IMAGE_SIZE},
+ {IMAGE_SIZE, IMAGE_SIZE}};
for (int space = kJPEG_SkYUVColorSpace; space <= kLastEnum_SkYUVColorSpace;
++space) {
@@ -105,9 +110,10 @@ protected:
for (int i = 0; i < 6; ++i) {
SkAutoTUnref<GrFragmentProcessor> fp(
GrYUVtoRGBEffect::Create(texture[indices[i][0]],
- texture[indices[i][1]],
- texture[indices[i][2]],
- static_cast<SkYUVColorSpace>(space)));
+ texture[indices[i][1]],
+ texture[indices[i][2]],
+ sizes,
+ static_cast<SkYUVColorSpace>(space)));
if (fp) {
SkMatrix viewMatrix;
viewMatrix.setTranslate(x, y);
« no previous file with comments | « no previous file | src/gpu/SkGr.cpp » ('j') | src/gpu/effects/GrYUVtoRGBEffect.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698