blob: c9c362b050ec947b3bb1293453103370a2feec6b [file] [log] [blame]
halcanary86e5ab62015-04-14 06:25:19 -07001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include "gm.h"
9#include "SkColorMatrixFilter.h"
10#include "SkColorFilterImageFilter.h"
11
12// This GM renders correctly in 8888, but fails in PDF
13DEF_SIMPLE_GM(fadefilter, canvas, 256, 256) {
14 SkScalar matrix[20] = { 1, 0, 0, 0, 128.0f,
15 0, 1, 0, 0, 128.0f,
16 0, 0, 1, 0, 128.0f,
17 0, 0, 0, 1, 0 };
robertphillips5605b562016-04-05 11:50:42 -070018 sk_sp<SkColorFilter> colorFilter(SkColorFilter::MakeMatrixFilterRowMajor255(matrix));
halcanary86e5ab62015-04-14 06:25:19 -070019 SkPaint layerPaint;
robertphillips5605b562016-04-05 11:50:42 -070020 layerPaint.setImageFilter(SkColorFilterImageFilter::Make(std::move(colorFilter), nullptr));
halcanary86e5ab62015-04-14 06:25:19 -070021 canvas->drawRect(SkRect::MakeLTRB(64, 64, 192, 192), layerPaint);
22}