OLD | NEW |
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 "chrome/renderer/pepper/pepper_flash_renderer_host.h" | 5 #include "chrome/renderer/pepper/pepper_flash_renderer_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 if (params.glyph_indices.size() != params.glyph_advances.size() || | 203 if (params.glyph_indices.size() != params.glyph_advances.size() || |
204 params.glyph_indices.empty()) | 204 params.glyph_indices.empty()) |
205 return PP_ERROR_FAILED; | 205 return PP_ERROR_FAILED; |
206 | 206 |
207 int style = SkTypeface::kNormal; | 207 int style = SkTypeface::kNormal; |
208 if (static_cast<PP_BrowserFont_Trusted_Weight>(params.font_desc.weight) >= | 208 if (static_cast<PP_BrowserFont_Trusted_Weight>(params.font_desc.weight) >= |
209 PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD) | 209 PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD) |
210 style |= SkTypeface::kBold; | 210 style |= SkTypeface::kBold; |
211 if (params.font_desc.italic) | 211 if (params.font_desc.italic) |
212 style |= SkTypeface::kItalic; | 212 style |= SkTypeface::kItalic; |
213 sk_sp<SkTypeface> typeface(SkTypeface::CreateFromName( | 213 sk_sp<SkTypeface> typeface(SkTypeface::MakeFromName( |
214 params.font_desc.face.c_str(), static_cast<SkTypeface::Style>(style))); | 214 params.font_desc.face.c_str(), SkFontStyle::FromOldStyle(style))); |
215 if (!typeface) | 215 if (!typeface) |
216 return PP_ERROR_FAILED; | 216 return PP_ERROR_FAILED; |
217 | 217 |
218 EnterResourceNoLock<PPB_ImageData_API> enter( | 218 EnterResourceNoLock<PPB_ImageData_API> enter( |
219 params.image_data.host_resource(), true); | 219 params.image_data.host_resource(), true); |
220 if (enter.failed()) | 220 if (enter.failed()) |
221 return PP_ERROR_FAILED; | 221 return PP_ERROR_FAILED; |
222 | 222 |
223 PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(enter.object()); | 223 PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(enter.object()); |
224 SkCanvas* canvas = image->GetCanvas(); | 224 SkCanvas* canvas = image->GetCanvas(); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 rect.point.x, rect.point.y, rect.size.width, rect.size.height))) | 370 rect.point.x, rect.point.y, rect.size.width, rect.size.height))) |
371 return PP_OK; | 371 return PP_OK; |
372 return PP_ERROR_FAILED; | 372 return PP_ERROR_FAILED; |
373 } | 373 } |
374 | 374 |
375 int32_t PepperFlashRendererHost::OnInvokePrinting( | 375 int32_t PepperFlashRendererHost::OnInvokePrinting( |
376 ppapi::host::HostMessageContext* host_context) { | 376 ppapi::host::HostMessageContext* host_context) { |
377 pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance()); | 377 pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance()); |
378 return PP_OK; | 378 return PP_OK; |
379 } | 379 } |
OLD | NEW |