summaryrefslogtreecommitdiffstats
path: root/ppapi/cpp/dev/font_dev.cc
diff options
context:
space:
mode:
authordmichael@google.com <dmichael@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 14:45:44 +0000
committerdmichael@google.com <dmichael@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 14:45:44 +0000
commit6f2e3919c4709404d8d7b6742f9cd9989b799c98 (patch)
tree55a933f7e2988625f0f3ded5a562203c7e3921c9 /ppapi/cpp/dev/font_dev.cc
parent79ba2d8a26fe6c9b343c57fef57896a90baa3878 (diff)
downloadchromium_src-6f2e3919c4709404d8d7b6742f9cd9989b799c98.zip
chromium_src-6f2e3919c4709404d8d7b6742f9cd9989b799c98.tar.gz
chromium_src-6f2e3919c4709404d8d7b6742f9cd9989b799c98.tar.bz2
Make PPAPI headers compile with C compilers (gcc on Linux & Mac and MSVS on Windows). This includes changing bool to PP_Bool and adding a PP_INLINE macro.
TEST=tests/test_c_includes.c BUG=59791,53451 The first patch set is a straight copy of http://codereview.chromium.org/4019010/show which got LGTMed when PPAPI was in its own repo, but had to be rolled back in order to include chrome changes. IMPORTANT: This change will break plugin implementations that use the C interface, and might break others as well. Review URL: http://codereview.chromium.org/4310002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp/dev/font_dev.cc')
-rw-r--r--ppapi/cpp/dev/font_dev.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/ppapi/cpp/dev/font_dev.cc b/ppapi/cpp/dev/font_dev.cc
index 9e294fb..185c63f 100644
--- a/ppapi/cpp/dev/font_dev.cc
+++ b/ppapi/cpp/dev/font_dev.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "ppapi/cpp/common.h"
#include "ppapi/cpp/image_data.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/point.h"
@@ -77,8 +78,8 @@ void FontDescription_Dev::swap(FontDescription_Dev& other) {
TextRun_Dev::TextRun_Dev() {
pp_text_run_.text = text_.pp_var();
- pp_text_run_.rtl = false;
- pp_text_run_.override_direction = false;
+ pp_text_run_.rtl = PP_FALSE;
+ pp_text_run_.override_direction = PP_FALSE;
}
TextRun_Dev::TextRun_Dev(const std::string& text,
@@ -86,8 +87,8 @@ TextRun_Dev::TextRun_Dev(const std::string& text,
bool override_direction)
: text_(text) {
pp_text_run_.text = text_.pp_var();
- pp_text_run_.rtl = rtl;
- pp_text_run_.override_direction = override_direction;
+ pp_text_run_.rtl = BoolToPPBool(rtl);
+ pp_text_run_.override_direction = BoolToPPBool(override_direction);
}
TextRun_Dev::TextRun_Dev(const TextRun_Dev& other) : text_(other.text_) {
@@ -166,9 +167,13 @@ bool Font_Dev::DrawTextAt(ImageData* dest,
bool image_data_is_opaque) const {
if (!font_f)
return false;
- return font_f->DrawTextAt(pp_resource(), dest->pp_resource(),
- &text.pp_text_run(), &position.pp_point(),
- color, &clip.pp_rect(), image_data_is_opaque);
+ return PPBoolToBool(font_f->DrawTextAt(pp_resource(),
+ dest->pp_resource(),
+ &text.pp_text_run(),
+ &position.pp_point(),
+ color,
+ &clip.pp_rect(),
+ BoolToPPBool(image_data_is_opaque)));
}
int32_t Font_Dev::MeasureText(const TextRun_Dev& text) const {