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

Side by Side Diff: ppapi/proxy/serialized_structs.cc

Issue 12600019: Add Pepper TrueType font API plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/serialized_structs.h" 5 #include "ppapi/proxy/serialized_structs.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ppapi/c/dev/ppb_font_dev.h" 9 #include "ppapi/c/dev/ppb_font_dev.h"
10 #include "ppapi/c/pp_file_info.h" 10 #include "ppapi/c/pp_file_info.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 desc->face = StringVar::StringToPPVar(face); 73 desc->face = StringVar::StringToPPVar(face);
74 desc->family = static_cast<PP_BrowserFont_Trusted_Family>(family); 74 desc->family = static_cast<PP_BrowserFont_Trusted_Family>(family);
75 desc->size = size; 75 desc->size = size;
76 desc->weight = static_cast<PP_BrowserFont_Trusted_Weight>(weight); 76 desc->weight = static_cast<PP_BrowserFont_Trusted_Weight>(weight);
77 desc->italic = italic; 77 desc->italic = italic;
78 desc->small_caps = small_caps; 78 desc->small_caps = small_caps;
79 desc->letter_spacing = letter_spacing; 79 desc->letter_spacing = letter_spacing;
80 desc->word_spacing = word_spacing; 80 desc->word_spacing = word_spacing;
81 } 81 }
82 82
83 SerializedTrueTypeFontDesc::SerializedTrueTypeFontDesc()
84 : family(),
85 generic_family(),
86 style(),
87 weight(),
88 width(),
89 charset() {
90 }
91
92 SerializedTrueTypeFontDesc::~SerializedTrueTypeFontDesc() {}
93
94 void SerializedTrueTypeFontDesc::SetFromPPTrueTypeFontDesc(
95 const PP_TrueTypeFontDesc_Dev& desc) {
96 StringVar* string_var = StringVar::FromPPVar(desc.family);
97 family = string_var ? string_var->value() : std::string();
98
99 generic_family = desc.generic_family;
100 style = desc.style;
101 weight = desc.weight;
102 width = desc.width;
103 charset = desc.charset;
104 }
105
106 void SerializedTrueTypeFontDesc::SetToPPTrueTypeFontDesc(
dmichael (off chromium) 2013/03/12 18:07:58 I assume anything that starts with "Set" is modify
bbudge 2013/03/13 01:26:50 Done.
107 PP_TrueTypeFontDesc_Dev* desc) const {
108 desc->family = StringVar::StringToPPVar(family);
109
110 desc->generic_family = generic_family;
111 desc->style = style;
112 desc->weight = weight;
113 desc->width = width;
114 desc->charset = charset;
115 }
116
83 PPBFlash_DrawGlyphs_Params::PPBFlash_DrawGlyphs_Params() 117 PPBFlash_DrawGlyphs_Params::PPBFlash_DrawGlyphs_Params()
84 : instance(0), 118 : instance(0),
85 font_desc(), 119 font_desc(),
86 color(0) { 120 color(0) {
87 clip.point.x = 0; 121 clip.point.x = 0;
88 clip.point.y = 0; 122 clip.point.y = 0;
89 clip.size.height = 0; 123 clip.size.height = 0;
90 clip.size.width = 0; 124 clip.size.width = 0;
91 position.x = 0; 125 position.x = 0;
92 position.y = 0; 126 position.y = 0;
93 allow_subpixel_aa = PP_FALSE; 127 allow_subpixel_aa = PP_FALSE;
94 } 128 }
95 129
96 PPBFlash_DrawGlyphs_Params::~PPBFlash_DrawGlyphs_Params() {} 130 PPBFlash_DrawGlyphs_Params::~PPBFlash_DrawGlyphs_Params() {}
97 131
98 } // namespace proxy 132 } // namespace proxy
99 } // namespace ppapi 133 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698