aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-05-15 11:30:41 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-15 11:30:41 -0700
commit465706820d0d373f76ab4831c286115ee0d86b7a (patch)
treef9fc8bd24b4e517292b7d6eedc9d17863acce670 /gm
parentdaa57bfd4204f5a7d304c580bcf5ad99d0121e1f (diff)
Revert of Font variations. (patchset #26 id:500001 of https://codereview.chromium.org/1027373002/)
Reason for revert: Appears to be breaking Linux ARM bots: FAILED: /usr/local/google/home/mosaic-role/slave/repo_clients/chromium_tot/chromium/src/../../prebuilt/toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-g++ ... -o obj/third_party/skia/src/ports/skia_library.SkFontHost_FreeType.o ../../third_party/skia/src/ports/SkFontHost_FreeType.cpp:37:31: fatal error: freetype/ftmm.h: No such file or directory #include FT_MULTIPLE_MASTERS_H ^ compilation terminated. Original issue's description: > Font variations. > > Multiple Master and TrueType fonts support variation axes. > This implements back-end support for axes on platforms which > support it. > > Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97 > > Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9 TBR=reed@google.com,mtklein@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1139123008
Diffstat (limited to 'gm')
-rw-r--r--gm/fontscalerdistortable.cpp95
1 files changed, 0 insertions, 95 deletions
diff --git a/gm/fontscalerdistortable.cpp b/gm/fontscalerdistortable.cpp
deleted file mode 100644
index 715f32169c..0000000000
--- a/gm/fontscalerdistortable.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#include "gm.h"
-#include "Resources.h"
-#include "SkFixed.h"
-#include "SkFontDescriptor.h"
-#include "SkFontMgr.h"
-#include "SkTypeface.h"
-
-namespace skiagm {
-
-class FontScalerDistortableGM : public GM {
-public:
- FontScalerDistortableGM() {
- this->setBGColor(0xFFFFFFFF);
- }
-
- virtual ~FontScalerDistortableGM() { }
-
-protected:
-
- SkString onShortName() override {
- return SkString("fontscalerdistortable");
- }
-
- SkISize onISize() override {
- return SkISize::Make(550, 700);
- }
-
- static void rotate_about(SkCanvas* canvas, SkScalar degrees, SkScalar px, SkScalar py) {
- canvas->translate(px, py);
- canvas->rotate(degrees);
- canvas->translate(-px, -py);
- }
-
- void onDraw(SkCanvas* canvas) override {
- SkPaint paint;
- paint.setAntiAlias(true);
- paint.setLCDRenderText(true);
-
- SkAutoTDelete<SkStreamAsset> distortable(GetResourceAsStream("/fonts/Distortable.ttf"));
- if (!distortable) {
- return;
- }
- const char* text = "abc";
- const size_t textLen = strlen(text);
-
- for (int j = 0; j < 2; ++j) {
- for (int i = 0; i < 5; ++i) {
- SkScalar x = SkIntToScalar(10);
- SkScalar y = SkIntToScalar(20);
-
- SkFixed axis = SkDoubleToFixed(0.5 + (5*j + i) * ((2.0 - 0.5) / (2 * 5)));
- SkAutoTUnref<SkTypeface> typeface(SkTypeface::CreateFromFontData(
- new SkFontData(distortable->duplicate(), 0, &axis, 1)));
- paint.setTypeface(typeface);
-
- SkAutoCanvasRestore acr(canvas, true);
- canvas->translate(SkIntToScalar(30 + i * 100), SkIntToScalar(20));
- rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10);
-
- {
- SkPaint p;
- p.setAntiAlias(true);
- SkRect r;
- r.set(x - SkIntToScalar(3), SkIntToScalar(15),
- x - SkIntToScalar(1), SkIntToScalar(280));
- canvas->drawRect(r, p);
- }
-
- for (int ps = 6; ps <= 22; ps++) {
- paint.setTextSize(SkIntToScalar(ps));
- canvas->drawText(text, textLen, x, y, paint);
- y += paint.getFontMetrics(NULL);
- }
- }
- canvas->translate(0, SkIntToScalar(360));
- paint.setSubpixelText(true);
- }
- }
-
-private:
- typedef GM INHERITED;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-
-static GM* MyFactory(void*) { return new FontScalerDistortableGM; }
-static GMRegistry reg(MyFactory);
-
-}