7fde8e1728
This almost gets gms to be iwyu clean. The last bit is around gm.cpp and the tracing framework and its use of atomic. Will also need a way of keeping things from regressing, which is difficult due to needing to do this outside-in. Change-Id: I1393531e99da8b0f1a29f55c53c86d53f459af7d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211593 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
35 lines
871 B
C++
35 lines
871 B
C++
/*
|
|
* 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/SkFont.h"
|
|
#include "include/core/SkPaint.h"
|
|
#include "include/utils/SkTextUtils.h"
|
|
|
|
#include <initializer_list>
|
|
|
|
class SkCanvas;
|
|
|
|
// http://bug.skia.org/7315
|
|
DEF_SIMPLE_GM(text_scale_skew, canvas, 256, 128) {
|
|
SkPaint p;
|
|
p.setAntiAlias(true);
|
|
SkFont font;
|
|
font.setSize(18.0f);
|
|
float y = 10.0f;
|
|
for (float scale : { 0.5f, 0.71f, 1.0f, 1.41f, 2.0f }) {
|
|
font.setScaleX(scale);
|
|
y += font.getSpacing();
|
|
float x = 50.0f;
|
|
for (float skew : { -0.5f, 0.0f, 0.5f }) {
|
|
font.setSkewX(skew);
|
|
SkTextUtils::DrawString(canvas, "Skia", x, y, font, p, SkTextUtils::kCenter_Align);
|
|
x += 78.0f;
|
|
}
|
|
}
|
|
}
|