Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: webkit/plugins/ppapi/ppb_font_impl.h

Issue 6981001: Make the Pepper proxy support in-process font rendering. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FONT_IMPL_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_FONT_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPB_FONT_IMPL_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPB_FONT_IMPL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ppapi/c/dev/ppb_font_dev.h" 10 #include "ppapi/c/dev/ppb_font_dev.h"
11 #include "ppapi/shared_impl/font_impl.h"
12 #include "ppapi/thunk/ppb_font_api.h"
11 #include "webkit/plugins/ppapi/resource.h" 13 #include "webkit/plugins/ppapi/resource.h"
12 14
13 namespace WebKit { 15 namespace WebKit {
14 class WebFont; 16 class WebFont;
15 } 17 }
16 18
17 namespace webkit { 19 namespace webkit {
18 namespace ppapi { 20 namespace ppapi {
19 21
20 class PluginInstance; 22 class PluginInstance;
21 23
22 class PPB_Font_Impl : public Resource { 24 class PPB_Font_Impl : public Resource,
25 public ::ppapi::thunk::PPB_Font_API,
26 public pp::shared_impl::FontImpl {
23 public: 27 public:
24 PPB_Font_Impl(PluginInstance* instance, const PP_FontDescription_Dev& desc); 28 PPB_Font_Impl(PluginInstance* instance, const PP_FontDescription_Dev& desc);
25 virtual ~PPB_Font_Impl(); 29 virtual ~PPB_Font_Impl();
26 30
27 // Returns a pointer to the interface implementing PPB_Font that is exposed to 31 // Returns a pointer to the interface implementing PPB_Font that is exposed to
28 // the plugin. 32 // the plugin.
29 static const PPB_Font_Dev* GetInterface(); 33 static const PPB_Font_Dev* GetInterface();
30 34
35 // ResourceObjectBase.
36 virtual ::ppapi::thunk::PPB_Font_API* AsFont_API() OVERRIDE;
37
31 // Resource overrides. 38 // Resource overrides.
32 virtual PPB_Font_Impl* AsPPB_Font_Impl(); 39 virtual PPB_Font_Impl* AsPPB_Font_Impl() OVERRIDE;
33 40
34 // PPB_Font implementation. 41 // PPB_Font implementation.
35 bool Describe(PP_FontDescription_Dev* description, 42 PP_Bool Describe(PP_FontDescription_Dev* description,
36 PP_FontMetrics_Dev* metrics); 43 PP_FontMetrics_Dev* metrics) OVERRIDE;
37 bool DrawTextAt(PP_Resource image_data, 44 PP_Bool DrawTextAt(PP_Resource image_data,
38 const PP_TextRun_Dev* text, 45 const PP_TextRun_Dev* text,
39 const PP_Point* position, 46 const PP_Point* position,
40 uint32_t color, 47 uint32_t color,
41 const PP_Rect* clip, 48 const PP_Rect* clip,
42 bool image_data_is_opaque); 49 PP_Bool image_data_is_opaque) OVERRIDE;
43 int32_t MeasureText(const PP_TextRun_Dev* text); 50 int32_t MeasureText(const PP_TextRun_Dev* text) OVERRIDE;
44 uint32_t CharacterOffsetForPixel(const PP_TextRun_Dev* text, 51 uint32_t CharacterOffsetForPixel(const PP_TextRun_Dev* text,
45 int32_t pixel_position); 52 int32_t pixel_position) OVERRIDE;
46 int32_t PixelOffsetForCharacter(const PP_TextRun_Dev* text, 53 int32_t PixelOffsetForCharacter(const PP_TextRun_Dev* text,
47 uint32_t char_offset); 54 uint32_t char_offset) OVERRIDE;
48 55
49 private: 56 private:
50 scoped_ptr<WebKit::WebFont> font_;
51
52 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Impl); 57 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Impl);
53 }; 58 };
54 59
55 } // namespace ppapi 60 } // namespace ppapi
56 } // namespace webkit 61 } // namespace webkit
57 62
58 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FONT_IMPL_H_ 63 #endif // WEBKIT_PLUGINS_PPAPI_PPB_FONT_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698