| 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 "chrome/renderer/chrome_ppb_pdf_impl.h" | 5 #include "chrome/renderer/chrome_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 "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 return 0; | 171 return 0; |
| 172 } | 172 } |
| 173 | 173 |
| 174 webkit::ppapi::ImageDataAutoMapper mapper(image_data); | 174 webkit::ppapi::ImageDataAutoMapper mapper(image_data); |
| 175 if (!mapper.is_valid()) | 175 if (!mapper.is_valid()) |
| 176 return 0; | 176 return 0; |
| 177 | 177 |
| 178 skia::PlatformCanvas* canvas = image_data->mapped_canvas(); | 178 skia::PlatformCanvas* canvas = image_data->mapped_canvas(); |
| 179 // Note: Do not skBitmap::copyTo the canvas bitmap directly because it will | 179 // Note: Do not skBitmap::copyTo the canvas bitmap directly because it will |
| 180 // ignore the allocated pixels in shared memory and re-allocate a new buffer. | 180 // ignore the allocated pixels in shared memory and re-allocate a new buffer. |
| 181 skia::GetTopDevice(*canvas)->writePixels(*res_bitmap, 0, 0); | 181 canvas->writePixels(*res_bitmap, 0, 0); |
| 182 | 182 |
| 183 return image_data->GetReference(); | 183 return image_data->GetReference(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 PP_Resource GetFontFileWithFallback( | 186 PP_Resource GetFontFileWithFallback( |
| 187 PP_Instance instance_id, | 187 PP_Instance instance_id, |
| 188 const PP_FontDescription_Dev* description, | 188 const PP_FontDescription_Dev* description, |
| 189 PP_PrivateFontCharset charset) { | 189 PP_PrivateFontCharset charset) { |
| 190 #if defined(OS_LINUX) | 190 #if defined(OS_LINUX) |
| 191 // Validate the instance before using it below. | 191 // Validate the instance before using it below. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 &SaveAs | 351 &SaveAs |
| 352 }; | 352 }; |
| 353 | 353 |
| 354 // static | 354 // static |
| 355 const PPB_PDF* PPB_PDF_Impl::GetInterface() { | 355 const PPB_PDF* PPB_PDF_Impl::GetInterface() { |
| 356 return &ppb_pdf; | 356 return &ppb_pdf; |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace chrome | 359 } // namespace chrome |
| 360 | 360 |
| OLD | NEW |