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

Side by Side Diff: ppapi/shared_impl/resource_object_base.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
« no previous file with comments | « ppapi/shared_impl/font_impl.cc ('k') | ppapi/shared_impl/webkit_forwarding.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_ 5 #ifndef PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_
6 #define PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_ 6 #define PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_
7 7
8 namespace ppapi { 8 namespace ppapi {
9 9
10 namespace thunk { 10 namespace thunk {
11 class PPB_Font_API;
11 class PPB_Graphics2D_API; 12 class PPB_Graphics2D_API;
12 class PPB_ImageData_API; 13 class PPB_ImageData_API;
13 } 14 }
14 15
15 namespace shared_impl { 16 namespace shared_impl {
16 17
17 class ResourceObjectBase { 18 class ResourceObjectBase {
18 public: 19 public:
19 20
21 virtual thunk::PPB_Font_API* AsFont_API() { return NULL; }
20 virtual thunk::PPB_Graphics2D_API* AsGraphics2D_API() { return NULL; } 22 virtual thunk::PPB_Graphics2D_API* AsGraphics2D_API() { return NULL; }
21 virtual thunk::PPB_ImageData_API* AsImageData_API() { return NULL; } 23 virtual thunk::PPB_ImageData_API* AsImageData_API() { return NULL; }
22 24
23 template <typename T> T* GetAs() { return NULL; } 25 template <typename T> T* GetAs() { return NULL; }
24 }; 26 };
25 27
26 template<> 28 template<>
29 inline thunk::PPB_Font_API* ResourceObjectBase::GetAs() {
30 return AsFont_API();
31 }
32 template<>
27 inline thunk::PPB_Graphics2D_API* ResourceObjectBase::GetAs() { 33 inline thunk::PPB_Graphics2D_API* ResourceObjectBase::GetAs() {
28 return AsGraphics2D_API(); 34 return AsGraphics2D_API();
29 } 35 }
30 template<> 36 template<>
31 inline thunk::PPB_ImageData_API* ResourceObjectBase::GetAs() { 37 inline thunk::PPB_ImageData_API* ResourceObjectBase::GetAs() {
32 return AsImageData_API(); 38 return AsImageData_API();
33 } 39 }
34 40
35 } // namespace shared_impl 41 } // namespace shared_impl
36 } // namespace ppapi 42 } // namespace ppapi
37 43
38 #endif // PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_ 44 #endif // PPAPI_SHARED_IMPL_RESOURCE_OBJECT_BASE_H_
OLDNEW
« no previous file with comments | « ppapi/shared_impl/font_impl.cc ('k') | ppapi/shared_impl/webkit_forwarding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698