make glyph_pos imageblur* largeglyphblur portable
R=reed@google.com,bungeman@google.com Review URL: https://codereview.chromium.org/1243493003
This commit is contained in:
parent
31b21f6719
commit
ef14cb397c
@ -48,9 +48,6 @@ protected:
|
||||
SkISize onISize() override { return SkISize::Make(800, 600); }
|
||||
|
||||
void onDraw(SkCanvas* canvas) override {
|
||||
if (!fProp) {
|
||||
fProp.reset(sk_tool_utils::create_portable_typeface("Helvetica", SkTypeface::kNormal));
|
||||
}
|
||||
|
||||
// There's a black pixel at 40, 40 for reference.
|
||||
canvas->drawPoint(40.0f, 40.0f, SK_ColorBLACK);
|
||||
@ -108,8 +105,7 @@ protected:
|
||||
paint.setColor(SK_ColorBLACK);
|
||||
paint.setAntiAlias(true);
|
||||
paint.setTextSize(kTextHeight * textScale);
|
||||
paint.setTypeface(fProp);
|
||||
paint.setDevKernText(true);
|
||||
sk_tool_utils::set_portable_typeface_always(&paint);
|
||||
paint.setStrokeWidth(fStrokeWidth);
|
||||
paint.setStyle(fStrokeStyle);
|
||||
|
||||
@ -158,7 +154,6 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
SkAutoTUnref<SkTypeface> fProp;
|
||||
SkScalar fStrokeWidth;
|
||||
SkPaint::Style fStrokeStyle;
|
||||
|
||||
|
@ -41,11 +41,11 @@ protected:
|
||||
SkRandom rand;
|
||||
SkPaint textPaint;
|
||||
textPaint.setAntiAlias(true);
|
||||
sk_tool_utils::set_portable_typeface(&textPaint);
|
||||
sk_tool_utils::set_portable_typeface_always(&textPaint);
|
||||
for (int i = 0; i < 25; ++i) {
|
||||
int x = rand.nextULessThan(WIDTH);
|
||||
int y = rand.nextULessThan(HEIGHT);
|
||||
textPaint.setColor(rand.nextBits(24) | 0xFF000000);
|
||||
textPaint.setColor(sk_tool_utils::color_to_565(rand.nextBits(24) | 0xFF000000));
|
||||
textPaint.setTextSize(rand.nextRangeScalar(0, 300));
|
||||
canvas->drawText(str, strlen(str), SkIntToScalar(x),
|
||||
SkIntToScalar(y), textPaint);
|
||||
|
@ -50,7 +50,7 @@ protected:
|
||||
};
|
||||
SkPaint textPaint;
|
||||
textPaint.setAntiAlias(true);
|
||||
sk_tool_utils::set_portable_typeface(&textPaint);
|
||||
sk_tool_utils::set_portable_typeface_always(&textPaint);
|
||||
textPaint.setTextSize(SkIntToScalar(100));
|
||||
int posY = 0;
|
||||
for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) {
|
||||
|
@ -32,7 +32,7 @@ protected:
|
||||
const char text[] = "Hamburgefons";
|
||||
|
||||
SkPaint paint;
|
||||
sk_tool_utils::set_portable_typeface(&paint);
|
||||
sk_tool_utils::set_portable_typeface_always(&paint);
|
||||
paint.setTextSize(256);
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user