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

Unified Diff: ppapi/cpp/trusted/browser_font_trusted.cc

Issue 1428653002: PPAPI: Remove PPB_Font_Dev. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/private/flash_font_file.cc ('k') | ppapi/examples/ime/ime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/trusted/browser_font_trusted.cc
diff --git a/ppapi/cpp/trusted/browser_font_trusted.cc b/ppapi/cpp/trusted/browser_font_trusted.cc
index 5d47469982502b2c5140fb57673a1e6a51c4a0d4..869f8bb6faf562a77283cc9163eea71a2a3646e7 100644
--- a/ppapi/cpp/trusted/browser_font_trusted.cc
+++ b/ppapi/cpp/trusted/browser_font_trusted.cc
@@ -6,7 +6,6 @@
#include <algorithm>
-#include "ppapi/c/dev/ppb_font_dev.h"
#include "ppapi/cpp/image_data.h"
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/point.h"
@@ -20,29 +19,6 @@ namespace {
template <> const char* interface_name<PPB_BrowserFont_Trusted_1_0>() {
return PPB_BROWSERFONT_TRUSTED_INTERFACE_1_0;
}
-template <> const char* interface_name<PPB_Font_Dev_0_6>() {
- return PPB_FONT_DEV_INTERFACE_0_6;
-}
-
-// This class provides backwards compat for PPB_Font, which is binary
-// compatible with the BrowserFont interface.
-// TODO(brettw) remove PPB_Font altogether when Flash is updated.
Lei Zhang 2015/10/28 05:13:23 Has Flash been updated? This TODO is 3.5 years old
-const PP_FontDescription_Dev* BrowserFontDescToFontDesc(
- const PP_BrowserFont_Trusted_Description* desc) {
- return reinterpret_cast<const PP_FontDescription_Dev*>(desc);
-}
-PP_FontDescription_Dev* BrowserFontDescToFontDesc(
- PP_BrowserFont_Trusted_Description* desc) {
- return reinterpret_cast<PP_FontDescription_Dev*>(desc);
-}
-PP_FontMetrics_Dev* BrowserFontMetricsToFontMetrics(
- PP_BrowserFont_Trusted_Metrics* metrics) {
- return reinterpret_cast<PP_FontMetrics_Dev*>(metrics);
-}
-const PP_TextRun_Dev* BrowserFontTextRunToFontTextRun(
- const PP_BrowserFont_Trusted_TextRun* run) {
- return reinterpret_cast<const PP_TextRun_Dev*>(run);
-}
} // namespace
@@ -137,10 +113,6 @@ BrowserFont_Trusted::BrowserFont_Trusted(
PassRefFromConstructor(get_interface<PPB_BrowserFont_Trusted_1_0>()->Create(
instance.pp_instance(),
&description.pp_font_description()));
- } else if (!has_interface<PPB_Font_Dev_0_6>()) {
- PassRefFromConstructor(get_interface<PPB_Font_Dev_0_6>()->Create(
- instance.pp_instance(),
- BrowserFontDescToFontDesc(&description.pp_font_description())));
}
}
@@ -156,10 +128,11 @@ BrowserFont_Trusted& BrowserFont_Trusted::operator=(
// static
Var BrowserFont_Trusted::GetFontFamilies(const InstanceHandle& instance) {
- if (!has_interface<PPB_Font_Dev_0_6>())
+ if (!has_interface<PPB_BrowserFont_Trusted_1_0>())
return Var();
+
return Var(PASS_REF,
- get_interface<PPB_Font_Dev_0_6>()->GetFontFamilies(
+ get_interface<PPB_BrowserFont_Trusted_1_0>()->GetFontFamilies(
instance.pp_instance()));
}
@@ -172,12 +145,6 @@ bool BrowserFont_Trusted::Describe(
if (!get_interface<PPB_BrowserFont_Trusted_1_0>()->Describe(
pp_resource(), &description->pp_font_description_, metrics))
return false;
- } else if (!has_interface<PPB_Font_Dev_0_6>()) {
- if (!get_interface<PPB_Font_Dev_0_6>()->Describe(
- pp_resource(),
- BrowserFontDescToFontDesc(&description->pp_font_description_),
- BrowserFontMetricsToFontMetrics(metrics)))
- return false;
}
description->face_ = Var(PASS_REF,
description->pp_font_description_.face);
@@ -199,15 +166,6 @@ bool BrowserFont_Trusted::DrawTextAt(ImageData* dest,
color,
&clip.pp_rect(),
PP_FromBool(image_data_is_opaque)));
- } else if (!has_interface<PPB_Font_Dev_0_6>()) {
- return PP_ToBool(get_interface<PPB_Font_Dev_0_6>()->DrawTextAt(
- pp_resource(),
- dest->pp_resource(),
- BrowserFontTextRunToFontTextRun(&text.pp_text_run()),
- &position.pp_point(),
- color,
- &clip.pp_rect(),
- PP_FromBool(image_data_is_opaque)));
}
return false;
}
@@ -217,10 +175,6 @@ int32_t BrowserFont_Trusted::MeasureText(const BrowserFontTextRun& text) const {
return get_interface<PPB_BrowserFont_Trusted_1_0>()->MeasureText(
pp_resource(),
&text.pp_text_run());
- } else if (!has_interface<PPB_Font_Dev_0_6>()) {
- return get_interface<PPB_Font_Dev_0_6>()->MeasureText(
- pp_resource(),
- BrowserFontTextRunToFontTextRun(&text.pp_text_run()));
}
return -1;
}
@@ -234,11 +188,6 @@ uint32_t BrowserFont_Trusted::CharacterOffsetForPixel(
pp_resource(),
&text.pp_text_run(),
pixel_position);
- } else if (!has_interface<PPB_Font_Dev_0_6>()) {
- return get_interface<PPB_Font_Dev_0_6>()->CharacterOffsetForPixel(
- pp_resource(),
- BrowserFontTextRunToFontTextRun(&text.pp_text_run()),
- pixel_position);
}
return 0;
}
@@ -252,11 +201,6 @@ int32_t BrowserFont_Trusted::PixelOffsetForCharacter(
pp_resource(),
&text.pp_text_run(),
char_offset);
- } else if (!has_interface<PPB_Font_Dev_0_6>()) {
- return get_interface<PPB_Font_Dev_0_6>()->PixelOffsetForCharacter(
- pp_resource(),
- BrowserFontTextRunToFontTextRun(&text.pp_text_run()),
- char_offset);
}
return 0;
}
« no previous file with comments | « ppapi/cpp/private/flash_font_file.cc ('k') | ppapi/examples/ime/ime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698