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

Side by Side Diff: skia/sgl/SkTypeface.cpp

Issue 113827: Remove the remainder of the skia source code from the Chromium repo.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « skia/sgl/SkTemplatesPriv.h ('k') | skia/sgl/SkTypeface_fake.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "SkTypeface.h"
2 #include "SkFontHost.h"
3
4 static const SkTypeface* resolve_null_typeface(const SkTypeface* face)
5 {
6 if (NULL == face) {
7 face = SkFontHost::FindTypeface(NULL, NULL, SkTypeface::kNormal);
8 SkASSERT(face);
9 }
10 return face;
11 }
12
13 uint32_t SkTypeface::UniqueID(const SkTypeface* face)
14 {
15 return resolve_null_typeface(face)->uniqueID();
16 }
17
18 bool SkTypeface::Equal(const SkTypeface* facea, const SkTypeface* faceb)
19 {
20 return resolve_null_typeface(facea)->uniqueID() ==
21 resolve_null_typeface(faceb)->uniqueID();
22 }
23
24 ///////////////////////////////////////////////////////////////////////////////
25
26 SkTypeface* SkTypeface::Create(const char name[], Style style)
27 {
28 SkTypeface* face = SkFontHost::FindTypeface(NULL, name, style);
29 if (face)
30 face->ref();
31 return face;
32 }
33
34 SkTypeface* SkTypeface::CreateFromTypeface(const SkTypeface* family, Style s)
35 {
36 family = resolve_null_typeface(family);
37 SkTypeface* face = SkFontHost::FindTypeface(family, NULL, s);
38 face->ref();
39 return face;
40 }
41
42 SkTypeface* SkTypeface::CreateFromStream(SkStream* stream)
43 {
44 return SkFontHost::CreateTypeface(stream);
45 }
46
47 #include "SkMMapStream.h"
48 SkTypeface* SkTypeface::CreateFromFile(const char path[])
49 {
50 return SkFontHost::CreateTypeface(SkNEW_ARGS(SkMMAPStream, (path)));
51 }
52
53 ///////////////////////////////////////////////////////////////////////////////
54
55 void SkTypeface::serialize(SkWStream* stream) const {
56 SkFontHost::Serialize(this, stream);
57 }
58
59 SkTypeface* SkTypeface::Deserialize(SkStream* stream) {
60 SkTypeface* face = SkFontHost::Deserialize(stream);
61 face->ref();
62 return face;
63 }
64
65
OLDNEW
« no previous file with comments | « skia/sgl/SkTemplatesPriv.h ('k') | skia/sgl/SkTypeface_fake.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698