diff options
author | 2014-08-06 06:58:06 -0700 | |
---|---|---|
committer | 2014-08-06 06:58:06 -0700 | |
commit | 1b27704eba15be4e9d1997faac42038493a30be5 (patch) | |
tree | 867cb1e568681cdb719c9c3771bbfadf222b3787 /gm | |
parent | 847092c88be671c06bdf24aa02b5a66e7a593a15 (diff) |
Remove ALL font fallback logic from Skia.
R=reed@google.com, bungeman@google.com, caryclark@google.com
Author: djsollen@google.com
Review URL: https://codereview.chromium.org/434623002
Diffstat (limited to 'gm')
-rw-r--r-- | gm/androidfallback.cpp | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/gm/androidfallback.cpp b/gm/androidfallback.cpp deleted file mode 100644 index e0f36aae9e..0000000000 --- a/gm/androidfallback.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2013 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" - -namespace skiagm { - -class AndroidFallbackGM : public GM { -public: - AndroidFallbackGM() { - this->setBGColor(0xFFCCCCCC); - } - -protected: - virtual uint32_t onGetFlags() const SK_OVERRIDE { - // TODO(scroggo): Undo this if we decide to fix skia:1763. - return GM::kSkipPipe_Flag; - } - - virtual SkString onShortName() SK_OVERRIDE { - return SkString("android_paint"); - } - - virtual SkISize onISize() SK_OVERRIDE { - return SkISize::Make(500, 500); - } - - virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { - - SkPaint paint; - paint.setTextEncoding(SkPaint::kUTF16_TextEncoding); - paint.setTextSize(24); - - SkPaintOptionsAndroid options = paint.getPaintOptionsAndroid(); - options.setUseFontFallbacks(true); - paint.setPaintOptionsAndroid(options); - - // "ื foo ๅ
่ bar เค" - const uint16_t unicodeStr[] = {0x05D0, 0x0020, 0x0066, 0x006F, 0x006F, 0x0020, 0x514D, - 0x820c, 0x0020, 0x0062, 0x0061, 0x0072, 0x0020, 0x0915}; - const int strLength = sizeof(unicodeStr) / sizeof(uint16_t); - const int strByteLength = sizeof(unicodeStr); - - SkScalar posX[strLength]; - SkPoint posXY[strLength]; - - for (int i = 0; i < strLength; ++i) { - posX[i] = SkIntToScalar(i * 24); - posXY[i].fX = posX[i]; - posXY[i].fY = SkIntToScalar(24 + i); - } - - canvas->translate(SkIntToScalar(10), SkIntToScalar(25)); - // This currently causes the PDF backend to assert - // canvas->drawText(unicodeStr, strByteLength, 0, 0, paint); - - canvas->translate(0, SkIntToScalar(75)); - canvas->drawPosTextH(unicodeStr, strByteLength, posX, 0, paint); - - options.setLanguage("ja"); - paint.setPaintOptionsAndroid(options); - - canvas->translate(0, SkIntToScalar(75)); - canvas->drawPosText(unicodeStr, strByteLength, posXY, paint); - - SkPath path; - path.moveTo(0, 0); - path.quadTo(50.0f, 100.0f, 250.0f, 150.0f); - - canvas->translate(0, SkIntToScalar(75)); - canvas->drawTextOnPath(unicodeStr, strByteLength, path, NULL, paint); - } - -private: - typedef GM INHERITED; -}; - -////////////////////////////////////////////////////////////////////////////// - -DEF_GM( return SkNEW(AndroidFallbackGM); ) - -} |