| 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_pdf_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_pdf_impl.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "grit/webkit_resources.h" | 10 #include "grit/webkit_resources.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 res_bitmap->width(), res_bitmap->height(), false)) { | 146 res_bitmap->width(), res_bitmap->height(), false)) { |
| 147 return 0; | 147 return 0; |
| 148 } | 148 } |
| 149 | 149 |
| 150 ImageDataAutoMapper mapper(image_data); | 150 ImageDataAutoMapper mapper(image_data); |
| 151 if (!mapper.is_valid()) | 151 if (!mapper.is_valid()) |
| 152 return 0; | 152 return 0; |
| 153 | 153 |
| 154 skia::PlatformCanvas* canvas = image_data->mapped_canvas(); | 154 skia::PlatformCanvas* canvas = image_data->mapped_canvas(); |
| 155 SkBitmap& ret_bitmap = | 155 SkBitmap& ret_bitmap = |
| 156 const_cast<SkBitmap&>(canvas->getTopPlatformDevice().accessBitmap(true)); | 156 const_cast<SkBitmap&>(skia::GetTopDevice(*canvas)->accessBitmap(true)); |
| 157 if (!res_bitmap->copyTo(&ret_bitmap, SkBitmap::kARGB_8888_Config, NULL)) { | 157 if (!res_bitmap->copyTo(&ret_bitmap, SkBitmap::kARGB_8888_Config, NULL)) { |
| 158 return 0; | 158 return 0; |
| 159 } | 159 } |
| 160 | 160 |
| 161 return image_data->GetReference(); | 161 return image_data->GetReference(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 PP_Resource GetFontFileWithFallback( | 164 PP_Resource GetFontFileWithFallback( |
| 165 PP_Instance instance_id, | 165 PP_Instance instance_id, |
| 166 const PP_FontDescription_Dev* description, | 166 const PP_FontDescription_Dev* description, |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 bool rv = webkit_glue::GetFontTable( | 337 bool rv = webkit_glue::GetFontTable( |
| 338 fd_, table, static_cast<uint8_t*>(output), &temp_size); | 338 fd_, table, static_cast<uint8_t*>(output), &temp_size); |
| 339 *output_length = static_cast<uint32_t>(temp_size); | 339 *output_length = static_cast<uint32_t>(temp_size); |
| 340 return rv; | 340 return rv; |
| 341 } | 341 } |
| 342 #endif | 342 #endif |
| 343 | 343 |
| 344 } // namespace ppapi | 344 } // namespace ppapi |
| 345 } // namespace webkit | 345 } // namespace webkit |
| 346 | 346 |
| OLD | NEW |