| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 return PP_ERROR_FAILED; | 205 return PP_ERROR_FAILED; |
| 206 | 206 |
| 207 // Set up the typeface. | 207 // Set up the typeface. |
| 208 int style = SkTypeface::kNormal; | 208 int style = SkTypeface::kNormal; |
| 209 if (static_cast<PP_BrowserFont_Trusted_Weight>(params.font_desc.weight) >= | 209 if (static_cast<PP_BrowserFont_Trusted_Weight>(params.font_desc.weight) >= |
| 210 PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD) | 210 PP_BROWSERFONT_TRUSTED_WEIGHT_BOLD) |
| 211 style |= SkTypeface::kBold; | 211 style |= SkTypeface::kBold; |
| 212 if (params.font_desc.italic) | 212 if (params.font_desc.italic) |
| 213 style |= SkTypeface::kItalic; | 213 style |= SkTypeface::kItalic; |
| 214 skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(SkTypeface::CreateFromName( | 214 skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(SkTypeface::CreateFromName( |
| 215 params.font_desc.face.c_str(), static_cast<SkTypeface::Style>(style))); | 215 params.font_desc.face.c_str(), SkFontStyle(style))); |
| 216 if (!typeface) | 216 if (!typeface) |
| 217 return PP_ERROR_FAILED; | 217 return PP_ERROR_FAILED; |
| 218 | 218 |
| 219 EnterResourceNoLock<PPB_ImageData_API> enter( | 219 EnterResourceNoLock<PPB_ImageData_API> enter( |
| 220 params.image_data.host_resource(), true); | 220 params.image_data.host_resource(), true); |
| 221 if (enter.failed()) | 221 if (enter.failed()) |
| 222 return PP_ERROR_FAILED; | 222 return PP_ERROR_FAILED; |
| 223 | 223 |
| 224 // Set up the canvas. | 224 // Set up the canvas. |
| 225 PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(enter.object()); | 225 PPB_ImageData_API* image = static_cast<PPB_ImageData_API*>(enter.object()); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 rect.point.x, rect.point.y, rect.size.width, rect.size.height))) | 373 rect.point.x, rect.point.y, rect.size.width, rect.size.height))) |
| 374 return PP_OK; | 374 return PP_OK; |
| 375 return PP_ERROR_FAILED; | 375 return PP_ERROR_FAILED; |
| 376 } | 376 } |
| 377 | 377 |
| 378 int32_t PepperFlashRendererHost::OnInvokePrinting( | 378 int32_t PepperFlashRendererHost::OnInvokePrinting( |
| 379 ppapi::host::HostMessageContext* host_context) { | 379 ppapi::host::HostMessageContext* host_context) { |
| 380 pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance()); | 380 pdf::PepperPDFHost::InvokePrintingForInstance(pp_instance()); |
| 381 return PP_OK; | 381 return PP_OK; |
| 382 } | 382 } |
| OLD | NEW |