| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/plugins/pepper_private2.h" | 5 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
| 6 | 6 |
| 7 #include "skia/ext/platform_canvas.h" | 7 #include "skia/ext/platform_canvas.h" |
| 8 #include "ppapi/c/pp_point.h" | 8 #include "ppapi/c/pp_point.h" |
| 9 #include "ppapi/c/pp_rect.h" | 9 #include "ppapi/c/pp_rect.h" |
| 10 #include "ppapi/c/dev/ppb_font_dev.h" | 10 #include "ppapi/c/dev/ppb_font_dev.h" |
| 11 #include "third_party/skia/include/core/SkCanvas.h" | 11 #include "third_party/skia/include/core/SkCanvas.h" |
| 12 #include "third_party/skia/include/core/SkMatrix.h" | 12 #include "third_party/skia/include/core/SkMatrix.h" |
| 13 #include "third_party/skia/include/core/SkPaint.h" | 13 #include "third_party/skia/include/core/SkPaint.h" |
| 14 #include "third_party/skia/include/core/SkPoint.h" | 14 #include "third_party/skia/include/core/SkPoint.h" |
| 15 #include "third_party/skia/include/core/SkTemplates.h" | 15 #include "third_party/skia/include/core/SkTemplates.h" |
| 16 #include "third_party/skia/include/core/SkTypeface.h" | 16 #include "third_party/skia/include/core/SkTypeface.h" |
| 17 #include "webkit/glue/plugins/pepper_image_data.h" | 17 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
| 18 #include "webkit/glue/plugins/pepper_var.h" | 18 #include "webkit/plugins/ppapi/var.h" |
| 19 | 19 |
| 20 namespace pepper { | 20 namespace webkit { |
| 21 namespace plugins { |
| 22 namespace ppapi { |
| 21 | 23 |
| 22 bool Private2::DrawGlyphs(PP_Resource pp_image_data, | 24 bool PPB_Flash_Impl::DrawGlyphs(PP_Resource pp_image_data, |
| 23 const PP_FontDescription_Dev* font_desc, | 25 const PP_FontDescription_Dev* font_desc, |
| 24 uint32_t color, | 26 uint32_t color, |
| 25 PP_Point position, | 27 PP_Point position, |
| 26 PP_Rect clip, | 28 PP_Rect clip, |
| 27 const float transformation[3][3], | 29 const float transformation[3][3], |
| 28 uint32_t glyph_count, | 30 uint32_t glyph_count, |
| 29 const uint16_t glyph_indices[], | 31 const uint16_t glyph_indices[], |
| 30 const PP_Point glyph_advances[]) { | 32 const PP_Point glyph_advances[]) { |
| 31 scoped_refptr<ImageData> image_resource( | 33 scoped_refptr<PPB_ImageData_Impl> image_resource( |
| 32 Resource::GetAs<ImageData>(pp_image_data)); | 34 Resource::GetAs<PPB_ImageData_Impl>(pp_image_data)); |
| 33 if (!image_resource.get()) | 35 if (!image_resource.get()) |
| 34 return false; | 36 return false; |
| 35 ImageDataAutoMapper mapper(image_resource); | 37 ImageDataAutoMapper mapper(image_resource); |
| 36 if (!mapper.is_valid()) | 38 if (!mapper.is_valid()) |
| 37 return false; | 39 return false; |
| 38 | 40 |
| 39 // Set up the typeface. | 41 // Set up the typeface. |
| 40 scoped_refptr<StringVar> face_name(StringVar::FromPPVar(font_desc->face)); | 42 scoped_refptr<StringVar> face_name(StringVar::FromPPVar(font_desc->face)); |
| 41 if (!face_name) | 43 if (!face_name) |
| 42 return false; | 44 return false; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 x += SkFloatToScalar(glyph_advances[i].x); | 101 x += SkFloatToScalar(glyph_advances[i].x); |
| 100 y += SkFloatToScalar(glyph_advances[i].y); | 102 y += SkFloatToScalar(glyph_advances[i].y); |
| 101 } | 103 } |
| 102 | 104 |
| 103 canvas->drawPosText(glyph_indices, glyph_count * 2, sk_positions, paint); | 105 canvas->drawPosText(glyph_indices, glyph_count * 2, sk_positions, paint); |
| 104 | 106 |
| 105 canvas->restore(); | 107 canvas->restore(); |
| 106 return true; | 108 return true; |
| 107 } | 109 } |
| 108 | 110 |
| 109 } // namespace pepper | 111 } // namespace ppapi |
| 112 } // namespace plugins |
| 113 } // namespace webkit |
| 110 | 114 |
| OLD | NEW |