blob: 142a926d66029b8a7ade614e1d90a7aa27802b2c [file] [log] [blame]
[email protected]0cf986f2011-03-28 10:45:011// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]fb35dcf2010-11-14 17:08:002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "ppapi/proxy/serialized_structs.h"
6
7#include "ppapi/c/dev/ppb_font_dev.h"
[email protected]4deeb432011-02-17 23:59:398#include "ppapi/c/dev/pp_file_info_dev.h"
[email protected]fb35dcf2010-11-14 17:08:009#include "ppapi/c/pp_rect.h"
10
11namespace pp {
12namespace proxy {
13
[email protected]aa20e062010-12-07 23:07:2714SerializedFontDescription::SerializedFontDescription()
15 : face(),
16 family(0),
17 size(0),
18 weight(0),
19 italic(PP_FALSE),
20 small_caps(PP_FALSE),
21 letter_spacing(0),
22 word_spacing(0) {
23}
24
25SerializedFontDescription::~SerializedFontDescription() {}
26
[email protected]fb35dcf2010-11-14 17:08:0027void SerializedFontDescription::SetFromPPFontDescription(
28 Dispatcher* dispatcher,
29 const PP_FontDescription_Dev& desc,
30 bool source_owns_ref) {
31 if (source_owns_ref)
32 face = SerializedVarSendInput(dispatcher, desc.face);
33 else
34 SerializedVarReturnValue(&face).Return(dispatcher, desc.face);
35
36 family = desc.family;
37 size = desc.size;
38 weight = desc.weight;
39 italic = desc.italic;
40 small_caps = desc.small_caps;
41 letter_spacing = desc.letter_spacing;
42 word_spacing = desc.word_spacing;
43}
44
45void SerializedFontDescription::SetToPPFontDescription(
46 Dispatcher* dispatcher,
47 PP_FontDescription_Dev* desc,
48 bool dest_owns_ref) const {
49 if (dest_owns_ref) {
50 ReceiveSerializedVarReturnValue face_return_value;
51 *static_cast<SerializedVar*>(&face_return_value) = face;
52 desc->face = face_return_value.Return(dispatcher);
53 } else {
54 desc->face = SerializedVarReceiveInput(face).Get(dispatcher);
55 }
56
57 desc->family = static_cast<PP_FontFamily_Dev>(family);
58 desc->size = size;
59 desc->weight = static_cast<PP_FontWeight_Dev>(weight);
60 desc->italic = italic;
61 desc->small_caps = small_caps;
62 desc->letter_spacing = letter_spacing;
63 desc->word_spacing = word_spacing;
64}
65
[email protected]4deeb432011-02-17 23:59:3966PPBFileRef_CreateInfo::PPBFileRef_CreateInfo()
67 : file_system_type(PP_FILESYSTEMTYPE_EXTERNAL) {
68}
69
[email protected]aa20e062010-12-07 23:07:2770PPBFlash_DrawGlyphs_Params::PPBFlash_DrawGlyphs_Params()
[email protected]859a7f32011-01-15 03:44:1371 : instance(0),
[email protected]aa20e062010-12-07 23:07:2772 font_desc(),
73 color(0) {
[email protected]0cf986f2011-03-28 10:45:0174 clip.point.x = 0;
75 clip.point.y = 0;
76 clip.size.height = 0;
77 clip.size.width = 0;
78 position.x = 0;
79 position.y = 0;
[email protected]aa20e062010-12-07 23:07:2780}
81
82PPBFlash_DrawGlyphs_Params::~PPBFlash_DrawGlyphs_Params() {}
83
[email protected]fb35dcf2010-11-14 17:08:0084} // namespace proxy
85} // namespace pp