Mike Klein | a8a51ce | 2018-01-09 12:34:11 -0500 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "SkPaint.h" |
| 9 | |
| 10 | #include "SkSemaphore.h" |
| 11 | #include "SkTypeface_remote.h" |
| 12 | #include <iostream> |
| 13 | |
| 14 | SkScalerContextProxy::SkScalerContextProxy( |
| 15 | sk_sp<SkTypeface> tf, |
| 16 | const SkScalerContextEffects& effects, |
| 17 | const SkDescriptor* desc, |
| 18 | SkRemoteScalerContext* rsc) |
| 19 | : SkScalerContext{std::move(tf), effects, desc} |
| 20 | , fRemote{rsc} {} |
| 21 | |
| 22 | void SkScalerContextProxy::generateMetrics(SkGlyph* glyph) { |
| 23 | fRemote->generateMetrics(*this->typefaceProxy(), this->getRec(), glyph); |
| 24 | } |
| 25 | |
| 26 | void SkScalerContextProxy::generateImage(const SkGlyph& glyph) { |
| 27 | fRemote->generateImage(*this->typefaceProxy(), this->getRec(), glyph); |
| 28 | } |
| 29 | |
| 30 | void SkScalerContextProxy::generatePath(SkGlyphID glyphID, SkPath* path) { |
| 31 | fRemote->generatePath(*this->typefaceProxy(), this->getRec(), glyphID, path); |
| 32 | } |
| 33 | |
| 34 | void SkScalerContextProxy::generateFontMetrics(SkPaint::FontMetrics* metrics) { |
| 35 | fRemote->generateFontMetrics(*this->typefaceProxy(), this->getRec(), metrics); |
| 36 | } |
| 37 | |
| 38 | SkTypefaceProxy* SkScalerContextProxy::typefaceProxy() { |
| 39 | auto up = this->getTypeface(); |
| 40 | return (SkTypefaceProxy *)up; |
| 41 | } |