| 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 ppapi { |
| 21 | 22 |
| 22 bool Private2::DrawGlyphs(PP_Resource pp_image_data, | 23 bool PPB_Flash_Impl::DrawGlyphs(PP_Resource pp_image_data, |
| 23 const PP_FontDescription_Dev* font_desc, | 24 const PP_FontDescription_Dev* font_desc, |
| 24 uint32_t color, | 25 uint32_t color, |
| 25 PP_Point position, | 26 PP_Point position, |
| 26 PP_Rect clip, | 27 PP_Rect clip, |
| 27 const float transformation[3][3], | 28 const float transformation[3][3], |
| 28 uint32_t glyph_count, | 29 uint32_t glyph_count, |
| 29 const uint16_t glyph_indices[], | 30 const uint16_t glyph_indices[], |
| 30 const PP_Point glyph_advances[]) { | 31 const PP_Point glyph_advances[]) { |
| 31 scoped_refptr<ImageData> image_resource( | 32 scoped_refptr<PPB_ImageData_Impl> image_resource( |
| 32 Resource::GetAs<ImageData>(pp_image_data)); | 33 Resource::GetAs<PPB_ImageData_Impl>(pp_image_data)); |
| 33 if (!image_resource.get()) | 34 if (!image_resource.get()) |
| 34 return false; | 35 return false; |
| 35 ImageDataAutoMapper mapper(image_resource); | 36 ImageDataAutoMapper mapper(image_resource); |
| 36 if (!mapper.is_valid()) | 37 if (!mapper.is_valid()) |
| 37 return false; | 38 return false; |
| 38 | 39 |
| 39 // Set up the typeface. | 40 // Set up the typeface. |
| 40 scoped_refptr<StringVar> face_name(StringVar::FromPPVar(font_desc->face)); | 41 scoped_refptr<StringVar> face_name(StringVar::FromPPVar(font_desc->face)); |
| 41 if (!face_name) | 42 if (!face_name) |
| 42 return false; | 43 return false; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 x += SkFloatToScalar(glyph_advances[i].x); | 100 x += SkFloatToScalar(glyph_advances[i].x); |
| 100 y += SkFloatToScalar(glyph_advances[i].y); | 101 y += SkFloatToScalar(glyph_advances[i].y); |
| 101 } | 102 } |
| 102 | 103 |
| 103 canvas->drawPosText(glyph_indices, glyph_count * 2, sk_positions, paint); | 104 canvas->drawPosText(glyph_indices, glyph_count * 2, sk_positions, paint); |
| 104 | 105 |
| 105 canvas->restore(); | 106 canvas->restore(); |
| 106 return true; | 107 return true; |
| 107 } | 108 } |
| 108 | 109 |
| 109 } // namespace pepper | 110 } // namespace ppapi |
| 111 } // namespace webkit |
| 110 | 112 |
| OLD | NEW |