* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkFilterQuality.h"
#include "include/core/SkImage.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkShader.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTileMode.h"
DEF_SIMPLE_GM(bug6783, canvas, 500, 500) {
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(100, 100);
SkPaint p;
p.setColor(SK_ColorYELLOW);
surface->getCanvas()->drawPaint(p);
p.setColor(SK_ColorBLUE);
surface->getCanvas()->drawRect(SkRect::MakeWH(50, 100), p);
sk_sp<SkImage> img = surface->makeImageSnapshot();
SkMatrix m = SkMatrix::Concat(SkMatrix::MakeTrans(25, 214),
SkMatrix::MakeScale(2, 2));
m.preSkew(0.5f, 0.5f);
p.setFilterQuality(kLow_SkFilterQuality);
p.setShader(img->makeShader(SkTileMode::kRepeat, SkTileMode::kClamp, &m));
canvas->drawPaint(p);
}