aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-27 12:53:13 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-27 12:53:13 +0000
commita04e8e842450e606dd938ddae17857849bd504d4 (patch)
tree5378470c55006b5e88dc22959280049c2fe77b5c /tests
parentb7b5d93359fdd3c5b2c48be7c5bbc4c978538af5 (diff)
Do premul and r/b swap conversions in a custom effect
Review URL: https://codereview.appspot.com/6473060/ git-svn-id: http://skia.googlecode.com/svn/trunk@5284 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/GLProgramsTest.cpp13
-rw-r--r--tests/WritePixelsTest.cpp6
2 files changed, 5 insertions, 14 deletions
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index e14198c6db..fd24518828 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -14,6 +14,7 @@
#include "gl/GrGpuGL.h"
#include "GrProgramStageFactory.h"
+#include "effects/GrConfigConversionEffect.h"
#include "GrRandom.h"
#include "Test.h"
@@ -44,12 +45,6 @@ const GrCustomStage* create_random_effect(StageDesc* stageDesc,
GrContext* context,
GrTexture* dummyTextures[]) {
- // TODO: Remove this when generator doesn't apply this non-custom-stage
- // notion to custom stages automatically.
- static const uint32_t kMulByAlphaMask =
- StageDesc::kMulRGBByAlpha_RoundUp_InConfigFlag |
- StageDesc::kMulRGBByAlpha_RoundDown_InConfigFlag;
-
// The new code uses SkRandom not GrRandom.
// TODO: Remove GrRandom.
SkRandom sk_random;
@@ -82,10 +77,6 @@ bool GrGpuGL::programUnitTest() {
};
static const int IN_CONFIG_FLAGS[] = {
StageDesc::kNone_InConfigFlag,
- StageDesc::kSwapRAndB_InConfigFlag,
- StageDesc::kSwapRAndB_InConfigFlag |
- StageDesc::kMulRGBByAlpha_RoundUp_InConfigFlag,
- StageDesc::kMulRGBByAlpha_RoundDown_InConfigFlag,
StageDesc::kSmearAlpha_InConfigFlag,
StageDesc::kSmearRed_InConfigFlag,
};
@@ -121,7 +112,6 @@ bool GrGpuGL::programUnitTest() {
pdesc.fExperimentalGS = this->getCaps().fGeometryShaderSupport &&
random_bool(&random);
#endif
- pdesc.fOutputConfig = random_int(&random, ProgramDesc::kOutputConfigCnt);
bool edgeAA = random_bool(&random);
if (edgeAA) {
@@ -212,6 +202,7 @@ void forceLinking();
void forceLinking() {
SkLightingImageFilter::CreateDistantLitDiffuse(SkPoint3(0,0,0), 0, 0, 0);
SkMagnifierImageFilter mag(SkRect::MakeWH(SK_Scalar1, SK_Scalar1), SK_Scalar1);
+ GrConfigConversionEffect::Create(NULL, false);
}
#endif
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 5a9cf26f78..4f045ef124 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -402,7 +402,7 @@ void WritePixelsTest(skiatest::Reporter* reporter, GrContext* context) {
for (size_t i = 0; i < SK_ARRAY_COUNT(gCanvasConfigs); ++i) {
REPORTER_ASSERT(reporter, setupCanvas(&canvas, gCanvasConfigs[i], context));
- static const SkCanvas::Config8888 gReadConfigs[] = {
+ static const SkCanvas::Config8888 gSrcConfigs[] = {
SkCanvas::kNative_Premul_Config8888,
SkCanvas::kNative_Unpremul_Config8888,
SkCanvas::kBGRA_Premul_Config8888,
@@ -413,9 +413,9 @@ void WritePixelsTest(skiatest::Reporter* reporter, GrContext* context) {
for (size_t r = 0; r < SK_ARRAY_COUNT(testRects); ++r) {
const SkIRect& rect = testRects[r];
for (int tightBmp = 0; tightBmp < 2; ++tightBmp) {
- for (size_t c = 0; c < SK_ARRAY_COUNT(gReadConfigs); ++c) {
+ for (size_t c = 0; c < SK_ARRAY_COUNT(gSrcConfigs); ++c) {
fillCanvas(&canvas);
- SkCanvas::Config8888 config8888 = gReadConfigs[c];
+ SkCanvas::Config8888 config8888 = gSrcConfigs[c];
SkBitmap bmp;
REPORTER_ASSERT(reporter, setupBitmap(&bmp, config8888, rect.width(), rect.height(), SkToBool(tightBmp)));
canvas.writePixels(bmp, rect.fLeft, rect.fTop, config8888);