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 #ifndef PPAPI_SHARED_IMPL_PRIVATE_PPB_BROWSER_FONT_TRUSTED_SHARED_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PRIVATE_PPB_BROWSER_FONT_TRUSTED_SHARED_H_ |
6 #define PPAPI_SHARED_IMPL_PRIVATE_PPB_BROWSER_FONT_TRUSTED_SHARED_H_ | 6 #define PPAPI_SHARED_IMPL_PRIVATE_PPB_BROWSER_FONT_TRUSTED_SHARED_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
16 #include "ppapi/shared_impl/ppapi_preferences.h" | 16 #include "ppapi/shared_impl/ppapi_preferences.h" |
17 #include "ppapi/shared_impl/ppapi_shared_export.h" | 17 #include "ppapi/shared_impl/ppapi_shared_export.h" |
18 #include "ppapi/shared_impl/resource.h" | 18 #include "ppapi/shared_impl/resource.h" |
19 #include "ppapi/thunk/ppb_browser_font_trusted_api.h" | 19 #include "ppapi/thunk/ppb_browser_font_trusted_api.h" |
20 | 20 |
21 namespace skia { | 21 class SkCanvas; |
22 class PlatformCanvas; | |
23 } | |
24 | 22 |
25 namespace WebKit { | 23 namespace WebKit { |
26 class WebFont; | 24 class WebFont; |
27 } | 25 } |
28 | 26 |
29 namespace ppapi { | 27 namespace ppapi { |
30 | 28 |
31 class PPAPI_SHARED_EXPORT PPB_BrowserFont_Trusted_Shared | 29 class PPAPI_SHARED_EXPORT PPB_BrowserFont_Trusted_Shared |
32 : public Resource, | 30 : public Resource, |
33 public thunk::PPB_BrowserFont_Trusted_API { | 31 public thunk::PPB_BrowserFont_Trusted_API { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const PP_BrowserFont_Trusted_TextRun* text, | 64 const PP_BrowserFont_Trusted_TextRun* text, |
67 uint32_t char_offset) OVERRIDE; | 65 uint32_t char_offset) OVERRIDE; |
68 | 66 |
69 private: | 67 private: |
70 PPB_BrowserFont_Trusted_Shared(ResourceObjectType type, | 68 PPB_BrowserFont_Trusted_Shared(ResourceObjectType type, |
71 PP_Instance instance, | 69 PP_Instance instance, |
72 const PP_BrowserFont_Trusted_Description& desc, | 70 const PP_BrowserFont_Trusted_Description& desc, |
73 const Preferences& prefs); | 71 const Preferences& prefs); |
74 | 72 |
75 // Internal version of DrawTextAt that takes a mapped PlatformCanvas. | 73 // Internal version of DrawTextAt that takes a mapped PlatformCanvas. |
76 void DrawTextToCanvas(skia::PlatformCanvas* destination, | 74 void DrawTextToCanvas(SkCanvas* destination, |
77 const PP_BrowserFont_Trusted_TextRun& text, | 75 const PP_BrowserFont_Trusted_TextRun& text, |
78 const PP_Point* position, | 76 const PP_Point* position, |
79 uint32_t color, | 77 uint32_t color, |
80 const PP_Rect* clip, | 78 const PP_Rect* clip, |
81 PP_Bool image_data_is_opaque); | 79 PP_Bool image_data_is_opaque); |
82 | 80 |
83 scoped_ptr<WebKit::WebFont> font_; | 81 scoped_ptr<WebKit::WebFont> font_; |
84 | 82 |
85 DISALLOW_COPY_AND_ASSIGN(PPB_BrowserFont_Trusted_Shared); | 83 DISALLOW_COPY_AND_ASSIGN(PPB_BrowserFont_Trusted_Shared); |
86 }; | 84 }; |
87 | 85 |
88 } // namespace ppapi | 86 } // namespace ppapi |
89 | 87 |
90 #endif // PPAPI_SHARED_IMPL_PRIVATE_PPB_BROWSER_FONT_TRUSTED_SHARED_H_ | 88 #endif // PPAPI_SHARED_IMPL_PRIVATE_PPB_BROWSER_FONT_TRUSTED_SHARED_H_ |
OLD | NEW |