Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Unified Diff: src/ports/SkFontHost_FreeType.cpp

Issue 12593013: remove SkFontHost::CreateScalerContext (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkTypeface.cpp ('k') | src/ports/SkFontHost_FreeType_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_FreeType.cpp
===================================================================
--- src/ports/SkFontHost_FreeType.cpp (revision 8224)
+++ src/ports/SkFontHost_FreeType.cpp (working copy)
@@ -159,7 +159,7 @@
class SkScalerContext_FreeType : public SkScalerContext_FreeType_Base {
public:
- SkScalerContext_FreeType(const SkDescriptor* desc);
+ SkScalerContext_FreeType(SkTypeface*, const SkDescriptor* desc);
virtual ~SkScalerContext_FreeType();
bool success() const {
@@ -650,7 +650,19 @@
bothZero(rec.fPost2x2[0][0], rec.fPost2x2[1][1]));
}
-void SkFontHost::FilterRec(SkScalerContext::Rec* rec, SkTypeface*) {
+SkScalerContext* SkTypeface_FreeType::onCreateScalerContext(
+ const SkDescriptor* desc) const {
+ SkScalerContext_FreeType* c = SkNEW_ARGS(SkScalerContext_FreeType,
+ (const_cast<SkTypeface_FreeType*>(this),
+ desc));
+ if (!c->success()) {
+ SkDELETE(c);
+ c = NULL;
+ }
+ return c;
+}
+
+void SkTypeface_FreeType::onFilterRec(SkScalerContextRec* rec) const {
//BOGUS: http://code.google.com/p/chromium/issues/detail?id=121119
//Cap the requested size as larger sizes give bogus values.
//Remove when http://code.google.com/p/skia/issues/detail?id=554 is fixed.
@@ -710,8 +722,9 @@
}
#endif
-SkScalerContext_FreeType::SkScalerContext_FreeType(const SkDescriptor* desc)
- : SkScalerContext_FreeType_Base(desc) {
+SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface,
+ const SkDescriptor* desc)
+ : SkScalerContext_FreeType_Base(typeface, desc) {
SkAutoMutexAcquire ac(gFTMutex);
if (gFTCount == 0) {
@@ -1300,17 +1313,6 @@
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
-SkScalerContext* SkFontHost::CreateScalerContext(const SkDescriptor* desc) {
- SkScalerContext_FreeType* c = SkNEW_ARGS(SkScalerContext_FreeType, (desc));
- if (!c->success()) {
- SkDELETE(c);
- c = NULL;
- }
- return c;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
/* Export this so that other parts of our FonttHost port can make use of our
ability to extract the name+style from a stream, using FreeType's api.
*/
« no previous file with comments | « src/core/SkTypeface.cpp ('k') | src/ports/SkFontHost_FreeType_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698