[email protected] | 0cf986f | 2011-03-28 10:45:01 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 2 | // 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] | 4deeb43 | 2011-02-17 23:59:39 | [diff] [blame] | 8 | #include "ppapi/c/dev/pp_file_info_dev.h" |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 9 | #include "ppapi/c/pp_rect.h" |
| 10 | |
| 11 | namespace pp { |
| 12 | namespace proxy { |
| 13 | |
[email protected] | aa20e06 | 2010-12-07 23:07:27 | [diff] [blame] | 14 | SerializedFontDescription::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 | |
| 25 | SerializedFontDescription::~SerializedFontDescription() {} |
| 26 | |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 27 | void 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 | |
| 45 | void 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] | 4deeb43 | 2011-02-17 23:59:39 | [diff] [blame] | 66 | PPBFileRef_CreateInfo::PPBFileRef_CreateInfo() |
| 67 | : file_system_type(PP_FILESYSTEMTYPE_EXTERNAL) { |
| 68 | } |
| 69 | |
[email protected] | aa20e06 | 2010-12-07 23:07:27 | [diff] [blame] | 70 | PPBFlash_DrawGlyphs_Params::PPBFlash_DrawGlyphs_Params() |
[email protected] | 859a7f3 | 2011-01-15 03:44:13 | [diff] [blame] | 71 | : instance(0), |
[email protected] | aa20e06 | 2010-12-07 23:07:27 | [diff] [blame] | 72 | font_desc(), |
| 73 | color(0) { |
[email protected] | 0cf986f | 2011-03-28 10:45:01 | [diff] [blame] | 74 | 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] | aa20e06 | 2010-12-07 23:07:27 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | PPBFlash_DrawGlyphs_Params::~PPBFlash_DrawGlyphs_Params() {} |
| 83 | |
[email protected] | fb35dcf | 2010-11-14 17:08:00 | [diff] [blame] | 84 | } // namespace proxy |
| 85 | } // namespace pp |