OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/ppapi/ppb_flash_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
6 | 6 |
7 #include "ppapi/c/pp_point.h" | 7 #include "ppapi/c/pp_point.h" |
8 #include "ppapi/c/pp_rect.h" | 8 #include "ppapi/c/pp_rect.h" |
9 #include "ppapi/c/dev/ppb_font_dev.h" | 9 #include "ppapi/c/dev/ppb_font_dev.h" |
10 #include "ppapi/shared_impl/var.h" | 10 #include "ppapi/shared_impl/var.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 if (enter.failed()) | 39 if (enter.failed()) |
40 return PP_FALSE; | 40 return PP_FALSE; |
41 PPB_ImageData_Impl* image_resource = | 41 PPB_ImageData_Impl* image_resource = |
42 static_cast<PPB_ImageData_Impl*>(enter.object()); | 42 static_cast<PPB_ImageData_Impl*>(enter.object()); |
43 | 43 |
44 ImageDataAutoMapper mapper(image_resource); | 44 ImageDataAutoMapper mapper(image_resource); |
45 if (!mapper.is_valid()) | 45 if (!mapper.is_valid()) |
46 return PP_FALSE; | 46 return PP_FALSE; |
47 | 47 |
48 // Set up the typeface. | 48 // Set up the typeface. |
49 scoped_refptr<StringVar> face_name(StringVar::FromPPVar(font_desc->face)); | 49 StringVar* face_name = StringVar::FromPPVar(font_desc->face); |
50 if (!face_name) | 50 if (!face_name) |
51 return PP_FALSE; | 51 return PP_FALSE; |
52 int style = SkTypeface::kNormal; | 52 int style = SkTypeface::kNormal; |
53 if (font_desc->weight >= PP_FONTWEIGHT_BOLD) | 53 if (font_desc->weight >= PP_FONTWEIGHT_BOLD) |
54 style |= SkTypeface::kBold; | 54 style |= SkTypeface::kBold; |
55 if (font_desc->italic) | 55 if (font_desc->italic) |
56 style |= SkTypeface::kItalic; | 56 style |= SkTypeface::kItalic; |
57 SkTypeface* typeface = | 57 SkTypeface* typeface = |
58 SkTypeface::CreateFromName(face_name->value().c_str(), | 58 SkTypeface::CreateFromName(face_name->value().c_str(), |
59 static_cast<SkTypeface::Style>(style)); | 59 static_cast<SkTypeface::Style>(style)); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 canvas->drawPosText(glyph_indices, glyph_count * 2, sk_positions, paint); | 112 canvas->drawPosText(glyph_indices, glyph_count * 2, sk_positions, paint); |
113 | 113 |
114 canvas->restore(); | 114 canvas->restore(); |
115 return PP_TRUE; | 115 return PP_TRUE; |
116 } | 116 } |
117 | 117 |
118 } // namespace ppapi | 118 } // namespace ppapi |
119 } // namespace webkit | 119 } // namespace webkit |
OLD | NEW |