summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-02 18:58:58 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-02 18:58:58 +0000
commite94cd2e516991ce237d574036b5b8a32cd94e8b1 (patch)
tree51367100a31c887582bd1470426bb533a473d12e /ppapi
parentad6e8a10ea9c47d76cb4eab0bdaae49af30c3e76 (diff)
downloadchromium_src-e94cd2e516991ce237d574036b5b8a32cd94e8b1.zip
chromium_src-e94cd2e516991ce237d574036b5b8a32cd94e8b1.tar.gz
chromium_src-e94cd2e516991ce237d574036b5b8a32cd94e8b1.tar.bz2
Add an API to determine if the system will support acceleration
BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10213005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/private/ppb_flash.idl27
-rw-r--r--ppapi/c/private/ppb_flash.h66
-rw-r--r--ppapi/cpp/private/flash.cc266
-rw-r--r--ppapi/cpp/private/flash.h3
-rw-r--r--ppapi/proxy/ppb_flash_proxy.cc11
-rw-r--r--ppapi/proxy/ppb_flash_proxy.h2
-rw-r--r--ppapi/shared_impl/ppapi_preferences.cc8
-rw-r--r--ppapi/shared_impl/ppapi_preferences.h2
-rw-r--r--ppapi/thunk/interfaces_ppb_private_flash.h7
-rw-r--r--ppapi/thunk/ppb_flash_api.h2
-rw-r--r--ppapi/thunk/ppb_flash_thunk.cc64
-rw-r--r--ppapi/thunk/ppb_graphics_3d_thunk.cc2
12 files changed, 243 insertions, 217 deletions
diff --git a/ppapi/api/private/ppb_flash.idl b/ppapi/api/private/ppb_flash.idl
index 50c4624..a3c9b77 100644
--- a/ppapi/api/private/ppb_flash.idl
+++ b/ppapi/api/private/ppb_flash.idl
@@ -10,7 +10,25 @@
label Chrome {
M17 = 12.0,
M19 = 12.1,
- M20 = 12.2
+ M20_0 = 12.2,
+ M20_1 = 12.3
+};
+
+[assert_size(4)]
+enum PP_FlashSetting {
+ /**
+ * Specifies if the system likely supports 3D hardware acceleration.
+ *
+ * The result is an int where 1 corresponds to true and 0 corresponds to
+ * false, depending on the supported nature of 3D acceleration. If querying
+ * this function returns 1, the 3D system will normally use the native
+ * hardware for rendering which will be much faster.
+ *
+ * In rare cases (depending on the platform) this value will be 1 but a
+ * created 3D context will use emulation because context initialization
+ * failed.
+ */
+ PP_FLASHSETTING_3DENABLED = 1
};
/**
@@ -136,6 +154,13 @@ interface PPB_Flash {
*/
[version=12.2]
PP_Var GetDeviceID([in] PP_Instance instance);
+
+ /**
+ * Returns the value associated with the given setting. Invalid enums will
+ * result in -1 return value.
+ */
+ [version=12.3]
+ int32_t GetSettingInt(PP_Instance instance, PP_FlashSetting setting);
};
#inline c
diff --git a/ppapi/c/private/ppb_flash.h b/ppapi/c/private/ppb_flash.h
index ba501a3..632285c8d 100644
--- a/ppapi/c/private/ppb_flash.h
+++ b/ppapi/c/private/ppb_flash.h
@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
-/* From private/ppb_flash.idl modified Tue Apr 24 16:54:09 2012. */
+/* From private/ppb_flash.idl modified Fri Apr 27 10:13:19 2012. */
#ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_
#define PPAPI_C_PRIVATE_PPB_FLASH_H_
@@ -24,7 +24,8 @@
#define PPB_FLASH_INTERFACE_12_0 "PPB_Flash;12.0"
#define PPB_FLASH_INTERFACE_12_1 "PPB_Flash;12.1"
#define PPB_FLASH_INTERFACE_12_2 "PPB_Flash;12.2"
-#define PPB_FLASH_INTERFACE PPB_FLASH_INTERFACE_12_2
+#define PPB_FLASH_INTERFACE_12_3 "PPB_Flash;12.3"
+#define PPB_FLASH_INTERFACE PPB_FLASH_INTERFACE_12_3
/**
* @file
@@ -33,6 +34,30 @@
/**
+ * @addtogroup Enums
+ * @{
+ */
+typedef enum {
+ /**
+ * Specifies if the system likely supports 3D hardware acceleration.
+ *
+ * The result is an int where 1 corresponds to true and 0 corresponds to
+ * false, depending on the supported nature of 3D acceleration. If querying
+ * this function returns 1, the 3D system will normally use the native
+ * hardware for rendering which will be much faster.
+ *
+ * In rare cases (depending on the platform) this value will be 1 but a
+ * created 3D context will use emulation because context initialization
+ * failed.
+ */
+ PP_FLASHSETTING_3DENABLED = 1
+} PP_FlashSetting;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_FlashSetting, 4);
+/**
+ * @}
+ */
+
+/**
* @addtogroup Interfaces
* @{
*/
@@ -40,7 +65,7 @@
* The <code>PPB_Flash</code> interface contains pointers to various functions
* that are only needed to support Pepper Flash.
*/
-struct PPB_Flash_12_2 {
+struct PPB_Flash_12_3 {
/**
* Sets or clears the rendering hint that the given plugin instance is always
* on top of page content. Somewhat more optimized painting can be used in
@@ -127,9 +152,14 @@ struct PPB_Flash_12_2 {
* Returns the device ID as a string. Returns a PP_VARTYPE_UNDEFINED on error.
*/
struct PP_Var (*GetDeviceID)(PP_Instance instance);
+ /**
+ * Returns the value associated with the given setting. Invalid enums will
+ * result in -1 return value.
+ */
+ int32_t (*GetSettingInt)(PP_Instance instance, PP_FlashSetting setting);
};
-typedef struct PPB_Flash_12_2 PPB_Flash;
+typedef struct PPB_Flash_12_3 PPB_Flash;
struct PPB_Flash_12_0 {
void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
@@ -181,6 +211,34 @@ struct PPB_Flash_12_1 {
int32_t (*InvokePrinting)(PP_Instance instance);
void (*UpdateActivity)(PP_Instance instance);
};
+
+struct PPB_Flash_12_2 {
+ void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
+ PP_Bool (*DrawGlyphs)(PP_Instance instance,
+ PP_Resource pp_image_data,
+ const struct PP_FontDescription_Dev* font_desc,
+ uint32_t color,
+ const struct PP_Point* position,
+ const struct PP_Rect* clip,
+ const float transformation[3][3],
+ PP_Bool allow_subpixel_aa,
+ uint32_t glyph_count,
+ const uint16_t glyph_indices[],
+ const struct PP_Point glyph_advances[]);
+ struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url);
+ int32_t (*Navigate)(PP_Resource request_info,
+ const char* target,
+ PP_Bool from_user_action);
+ void (*RunMessageLoop)(PP_Instance instance);
+ void (*QuitMessageLoop)(PP_Instance instance);
+ double (*GetLocalTimeZoneOffset)(PP_Instance instance, PP_Time t);
+ struct PP_Var (*GetCommandLineArgs)(PP_Module module);
+ void (*PreloadFontWin)(const void* logfontw);
+ PP_Bool (*IsRectTopmost)(PP_Instance instance, const struct PP_Rect* rect);
+ int32_t (*InvokePrinting)(PP_Instance instance);
+ void (*UpdateActivity)(PP_Instance instance);
+ struct PP_Var (*GetDeviceID)(PP_Instance instance);
+};
/**
* @}
*/
diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash.cc
index d5e2b39..968ecab 100644
--- a/ppapi/cpp/private/flash.cc
+++ b/ppapi/cpp/private/flash.cc
@@ -4,6 +4,8 @@
#include "ppapi/cpp/private/flash.h"
+#include <string.h>
+
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/cpp/dev/font_dev.h"
@@ -21,6 +23,10 @@ namespace pp {
namespace {
+template <> const char* interface_name<PPB_Flash_12_3>() {
+ return PPB_FLASH_INTERFACE_12_3;
+}
+
template <> const char* interface_name<PPB_Flash_12_2>() {
return PPB_FLASH_INTERFACE_12_2;
}
@@ -33,8 +39,34 @@ template <> const char* interface_name<PPB_Flash_12_0>() {
return PPB_FLASH_INTERFACE_12_0;
}
-template <> const char* interface_name<PPB_Flash_11>() {
- return PPB_FLASH_INTERFACE_11_0;
+
+// The combined Flash interface is all Flash v12.* interfaces. All v12
+// interfaces just append one or more functions to the previous one, so we can
+// have this meta one at the most recent version. Function pointers will be
+// null if they're not supported on the current Chrome version.
+bool initialized_combined_interface = false;
+PPB_Flash flash_12_combined_interface = {};
+
+// Makes sure that the most recent version is loaded into the combined
+// interface struct above. Any unsupported functions will be NULL. If there
+// is no Flash interface supported, all functions will be NULL.
+void InitializeCombinedInterface() {
+ if (initialized_combined_interface)
+ return;
+ if (has_interface<PPB_Flash_12_3>()) {
+ memcpy(&flash_12_combined_interface, get_interface<PPB_Flash_12_3>(),
+ sizeof(PPB_Flash_12_3));
+ } else if (has_interface<PPB_Flash_12_2>()) {
+ memcpy(&flash_12_combined_interface, get_interface<PPB_Flash_12_2>(),
+ sizeof(PPB_Flash_12_2));
+ } else if (has_interface<PPB_Flash_12_1>()) {
+ memcpy(&flash_12_combined_interface, get_interface<PPB_Flash_12_1>(),
+ sizeof(PPB_Flash_12_1));
+ } else if (has_interface<PPB_Flash_12_0>()) {
+ memcpy(&flash_12_combined_interface, get_interface<PPB_Flash_12_0>(),
+ sizeof(PPB_Flash_12_0));
+ }
+ initialized_combined_interface = true;
}
} // namespace
@@ -43,7 +75,8 @@ namespace flash {
// static
bool Flash::IsAvailable() {
- return has_interface<PPB_Flash_12_2>() ||
+ return has_interface<PPB_Flash_12_3>() ||
+ has_interface<PPB_Flash_12_2>() ||
has_interface<PPB_Flash_12_1>() ||
has_interface<PPB_Flash_12_0>() ||
has_interface<PPB_Flash_11>();
@@ -52,17 +85,9 @@ bool Flash::IsAvailable() {
// static
void Flash::SetInstanceAlwaysOnTop(const InstanceHandle& instance,
bool on_top) {
- if (has_interface<PPB_Flash_12_2>()) {
- get_interface<PPB_Flash_12_2>()->SetInstanceAlwaysOnTop(
- instance.pp_instance(), PP_FromBool(on_top));
- } else if (has_interface<PPB_Flash_12_1>()) {
- get_interface<PPB_Flash_12_1>()->SetInstanceAlwaysOnTop(
- instance.pp_instance(), PP_FromBool(on_top));
- } else if (has_interface<PPB_Flash_12_0>()) {
- get_interface<PPB_Flash_12_0>()->SetInstanceAlwaysOnTop(
- instance.pp_instance(), PP_FromBool(on_top));
- } else if (has_interface<PPB_Flash_11>()) {
- get_interface<PPB_Flash_11>()->SetInstanceAlwaysOnTop(
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.SetInstanceAlwaysOnTop) {
+ flash_12_combined_interface.SetInstanceAlwaysOnTop(
instance.pp_instance(), PP_FromBool(on_top));
}
}
@@ -79,22 +104,9 @@ bool Flash::DrawGlyphs(const InstanceHandle& instance,
uint32_t glyph_count,
const uint16_t glyph_indices[],
const PP_Point glyph_advances[]) {
- bool rv = false;
- if (has_interface<PPB_Flash_12_2>()) {
- rv = PP_ToBool(get_interface<PPB_Flash_12_2>()->DrawGlyphs(
- instance.pp_instance(),
- image->pp_resource(),
- &font_desc.pp_font_description(),
- color,
- &position.pp_point(),
- &clip.pp_rect(),
- transformation,
- PP_FromBool(allow_subpixel_aa),
- glyph_count,
- glyph_indices,
- glyph_advances));
- } else if (has_interface<PPB_Flash_12_1>()) {
- rv = PP_ToBool(get_interface<PPB_Flash_12_1>()->DrawGlyphs(
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.DrawGlyphs) {
+ return PP_ToBool(flash_12_combined_interface.DrawGlyphs(
instance.pp_instance(),
image->pp_resource(),
&font_desc.pp_font_description(),
@@ -106,207 +118,123 @@ bool Flash::DrawGlyphs(const InstanceHandle& instance,
glyph_count,
glyph_indices,
glyph_advances));
- } else if (has_interface<PPB_Flash_12_0>()) {
- rv = PP_ToBool(get_interface<PPB_Flash_12_0>()->DrawGlyphs(
- instance.pp_instance(),
- image->pp_resource(),
- &font_desc.pp_font_description(),
- color,
- &position.pp_point(),
- &clip.pp_rect(),
- transformation,
- PP_FromBool(allow_subpixel_aa),
- glyph_count,
- glyph_indices,
- glyph_advances));
- } else if (has_interface<PPB_Flash_11>()) {
- rv = PP_ToBool(get_interface<PPB_Flash_11>()->DrawGlyphs(
- instance.pp_instance(),
- image->pp_resource(),
- &font_desc.pp_font_description(),
- color,
- position.pp_point(),
- clip.pp_rect(),
- transformation,
- glyph_count,
- glyph_indices,
- glyph_advances));
}
- return rv;
+ return false;
}
// static
Var Flash::GetProxyForURL(const InstanceHandle& instance,
const std::string& url) {
- Var rv;
- if (has_interface<PPB_Flash_12_2>()) {
- rv = Var(PASS_REF,
- get_interface<PPB_Flash_12_2>()->GetProxyForURL(
- instance.pp_instance(), url.c_str()));
- } else if (has_interface<PPB_Flash_12_1>()) {
- rv = Var(PASS_REF,
- get_interface<PPB_Flash_12_1>()->GetProxyForURL(
- instance.pp_instance(), url.c_str()));
- } else if (has_interface<PPB_Flash_12_0>()) {
- rv = Var(PASS_REF,
- get_interface<PPB_Flash_12_0>()->GetProxyForURL(
- instance.pp_instance(), url.c_str()));
- } else if (has_interface<PPB_Flash_11>()) {
- rv = Var(PASS_REF,
- get_interface<PPB_Flash_11>()->GetProxyForURL(
- instance.pp_instance(), url.c_str()));
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.GetProxyForURL) {
+ return Var(PASS_REF, flash_12_combined_interface.GetProxyForURL(
+ instance.pp_instance(), url.c_str()));
}
- return rv;
+ return Var();
}
// static
int32_t Flash::Navigate(const URLRequestInfo& request_info,
const std::string& target,
bool from_user_action) {
- int32_t rv = PP_ERROR_FAILED;
- if (has_interface<PPB_Flash_12_2>()) {
- rv = get_interface<PPB_Flash_12_2>()->Navigate(
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.Navigate) {
+ return flash_12_combined_interface.Navigate(
request_info.pp_resource(),
target.c_str(),
PP_FromBool(from_user_action));
- } else if (has_interface<PPB_Flash_12_1>()) {
- rv = get_interface<PPB_Flash_12_1>()->Navigate(
- request_info.pp_resource(),
- target.c_str(),
- PP_FromBool(from_user_action));
- } else if (has_interface<PPB_Flash_12_0>()) {
- rv = get_interface<PPB_Flash_12_0>()->Navigate(
- request_info.pp_resource(),
- target.c_str(),
- PP_FromBool(from_user_action));
- } else if (has_interface<PPB_Flash_11>()) {
- rv = get_interface<PPB_Flash_11>()->Navigate(request_info.pp_resource(),
- target.c_str(),
- from_user_action);
}
- return rv;
+ return PP_ERROR_FAILED;
}
// static
void Flash::RunMessageLoop(const InstanceHandle& instance) {
- if (has_interface<PPB_Flash_12_2>())
- get_interface<PPB_Flash_12_2>()->RunMessageLoop(instance.pp_instance());
- else if (has_interface<PPB_Flash_12_1>())
- get_interface<PPB_Flash_12_1>()->RunMessageLoop(instance.pp_instance());
- else if (has_interface<PPB_Flash_12_0>())
- get_interface<PPB_Flash_12_0>()->RunMessageLoop(instance.pp_instance());
- else if (has_interface<PPB_Flash_11>())
- get_interface<PPB_Flash_11>()->RunMessageLoop(instance.pp_instance());
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.RunMessageLoop)
+ flash_12_combined_interface.RunMessageLoop(instance.pp_instance());
}
// static
void Flash::QuitMessageLoop(const InstanceHandle& instance) {
- if (has_interface<PPB_Flash_12_2>())
- get_interface<PPB_Flash_12_2>()->QuitMessageLoop(instance.pp_instance());
- else if (has_interface<PPB_Flash_12_1>())
- get_interface<PPB_Flash_12_1>()->QuitMessageLoop(instance.pp_instance());
- else if (has_interface<PPB_Flash_12_0>())
- get_interface<PPB_Flash_12_0>()->QuitMessageLoop(instance.pp_instance());
- else if (has_interface<PPB_Flash_11>())
- get_interface<PPB_Flash_11>()->QuitMessageLoop(instance.pp_instance());
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.QuitMessageLoop)
+ flash_12_combined_interface.QuitMessageLoop(instance.pp_instance());
}
// static
double Flash::GetLocalTimeZoneOffset(const InstanceHandle& instance,
PP_Time t) {
- double rv = 0;
- if (has_interface<PPB_Flash_12_2>()) {
- rv = get_interface<PPB_Flash_12_2>()->GetLocalTimeZoneOffset(
- instance.pp_instance(), t);
- } else if (has_interface<PPB_Flash_12_1>()) {
- rv = get_interface<PPB_Flash_12_1>()->GetLocalTimeZoneOffset(
- instance.pp_instance(), t);
- } else if (has_interface<PPB_Flash_12_0>()) {
- rv = get_interface<PPB_Flash_12_0>()->GetLocalTimeZoneOffset(
- instance.pp_instance(), t);
- } else if (has_interface<PPB_Flash_11>()) {
- rv = get_interface<PPB_Flash_11>()->GetLocalTimeZoneOffset(
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.GetLocalTimeZoneOffset) {
+ return flash_12_combined_interface.GetLocalTimeZoneOffset(
instance.pp_instance(), t);
}
- return rv;
+ return 0.0;
}
// static
Var Flash::GetCommandLineArgs(Module* module) {
- Var rv;
- if (has_interface<PPB_Flash_12_2>()) {
- rv = Var(PASS_REF,
- get_interface<PPB_Flash_12_2>()->GetCommandLineArgs(
- module->pp_module()));
- } else if (has_interface<PPB_Flash_12_1>()) {
- rv = Var(PASS_REF,
- get_interface<PPB_Flash_12_1>()->GetCommandLineArgs(
- module->pp_module()));
- } else if (has_interface<PPB_Flash_12_0>()) {
- rv = Var(PASS_REF,
- get_interface<PPB_Flash_12_0>()->GetCommandLineArgs(
- module->pp_module()));
- } else if (has_interface<PPB_Flash_11>()) {
- rv = Var(PASS_REF,
- get_interface<PPB_Flash_11>()->GetCommandLineArgs(
- module->pp_module()));
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.GetCommandLineArgs) {
+ return Var(
+ PASS_REF,
+ flash_12_combined_interface.GetCommandLineArgs(module->pp_module()));
}
- return rv;
+ return Var();
}
// static
void Flash::PreloadFontWin(const void* logfontw) {
- if (has_interface<PPB_Flash_12_2>())
- get_interface<PPB_Flash_12_2>()->PreloadFontWin(logfontw);
- else if (has_interface<PPB_Flash_12_1>())
- get_interface<PPB_Flash_12_1>()->PreloadFontWin(logfontw);
- else if (has_interface<PPB_Flash_12_0>())
- get_interface<PPB_Flash_12_0>()->PreloadFontWin(logfontw);
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.PreloadFontWin)
+ return flash_12_combined_interface.PreloadFontWin(logfontw);
}
// static
bool Flash::IsRectTopmost(const InstanceHandle& instance, const Rect& rect) {
- bool rv = false;
- if (has_interface<PPB_Flash_12_2>()) {
- rv = PP_ToBool(get_interface<PPB_Flash_12_2>()->IsRectTopmost(
- instance.pp_instance(), &rect.pp_rect()));
- } else if (has_interface<PPB_Flash_12_1>()) {
- rv = PP_ToBool(get_interface<PPB_Flash_12_1>()->IsRectTopmost(
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.IsRectTopmost) {
+ return PP_ToBool(flash_12_combined_interface.IsRectTopmost(
instance.pp_instance(), &rect.pp_rect()));
}
- return rv;
+ return false;
}
// static
int32_t Flash::InvokePrinting(const InstanceHandle& instance) {
- int32_t rv = PP_ERROR_NOTSUPPORTED;
- if (has_interface<PPB_Flash_12_2>()) {
- rv = get_interface<PPB_Flash_12_2>()->InvokePrinting(
- instance.pp_instance());
- } else if (has_interface<PPB_Flash_12_1>()) {
- rv = get_interface<PPB_Flash_12_1>()->InvokePrinting(
- instance.pp_instance());
- }
- return rv;
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.InvokePrinting)
+ return flash_12_combined_interface.InvokePrinting(instance.pp_instance());
+ return PP_ERROR_NOTSUPPORTED;
}
// static
void Flash::UpdateActivity(const InstanceHandle& instance) {
- if (has_interface<PPB_Flash_12_2>())
- get_interface<PPB_Flash_12_2>()->UpdateActivity(instance.pp_instance());
- if (has_interface<PPB_Flash_12_1>())
- get_interface<PPB_Flash_12_1>()->UpdateActivity(instance.pp_instance());
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.UpdateActivity)
+ flash_12_combined_interface.UpdateActivity(instance.pp_instance());
}
// static
Var Flash::GetDeviceID(const InstanceHandle& instance) {
- if (has_interface<PPB_Flash_12_2>()) {
- return Var(
- PASS_REF,
- get_interface<PPB_Flash_12_2>()->GetDeviceID(instance.pp_instance()));
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.GetDeviceID) {
+ return Var(PASS_REF,
+ flash_12_combined_interface.GetDeviceID(instance.pp_instance()));
}
return Var();
}
+// static
+int32_t Flash::GetSettingInt(const InstanceHandle& instance,
+ PP_FlashSetting setting) {
+ InitializeCombinedInterface();
+ if (flash_12_combined_interface.GetSettingInt) {
+ return flash_12_combined_interface.GetSettingInt(instance.pp_instance(),
+ setting);
+ }
+ return -1;
+}
+
} // namespace flash
} // namespace pp
diff --git a/ppapi/cpp/private/flash.h b/ppapi/cpp/private/flash.h
index a3a8d65..cb18316 100644
--- a/ppapi/cpp/private/flash.h
+++ b/ppapi/cpp/private/flash.h
@@ -7,6 +7,7 @@
#include <string>
+#include "ppapi/c/private/ppb_flash.h"
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_time.h"
@@ -58,6 +59,8 @@ class Flash {
static int32_t InvokePrinting(const InstanceHandle& instance);
static void UpdateActivity(const InstanceHandle& instance);
static Var GetDeviceID(const InstanceHandle& instance);
+ static int32_t GetSettingInt(const InstanceHandle& instance,
+ PP_FlashSetting setting);
};
} // namespace flash
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index 3db3dab..9442539 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -555,6 +555,17 @@ PP_Var PPB_Flash_Proxy::GetDeviceID(PP_Instance instance) {
return StringVar::StringToPPVar(id);
}
+int32_t PPB_Flash_Proxy::GetSettingInt(PP_Instance instance,
+ PP_FlashSetting setting) {
+ switch (setting) {
+ case PP_FLASHSETTING_3DENABLED:
+ return static_cast<PluginDispatcher*>(dispatcher())->preferences().
+ is_3d_supported;
+ default:
+ return -1;
+ }
+}
+
PP_Bool PPB_Flash_Proxy::IsClipboardFormatAvailable(
PP_Instance instance,
PP_Flash_Clipboard_Type clipboard_type,
diff --git a/ppapi/proxy/ppb_flash_proxy.h b/ppapi/proxy/ppb_flash_proxy.h
index 29c6a67..018ac4a 100644
--- a/ppapi/proxy/ppb_flash_proxy.h
+++ b/ppapi/proxy/ppb_flash_proxy.h
@@ -66,6 +66,8 @@ class PPB_Flash_Proxy : public InterfaceProxy, public PPB_Flash_Shared {
virtual int32_t InvokePrinting(PP_Instance instance) OVERRIDE;
virtual void UpdateActivity(PP_Instance instance) OVERRIDE;
virtual PP_Var GetDeviceID(PP_Instance instance) OVERRIDE;
+ virtual int32_t GetSettingInt(PP_Instance instance,
+ PP_FlashSetting setting) OVERRIDE;
virtual PP_Bool IsClipboardFormatAvailable(
PP_Instance instance,
PP_Flash_Clipboard_Type clipboard_type,
diff --git a/ppapi/shared_impl/ppapi_preferences.cc b/ppapi/shared_impl/ppapi_preferences.cc
index 1448806..c8a5b00 100644
--- a/ppapi/shared_impl/ppapi_preferences.cc
+++ b/ppapi/shared_impl/ppapi_preferences.cc
@@ -10,7 +10,8 @@ namespace ppapi {
Preferences::Preferences()
: default_font_size(0),
- default_fixed_font_size(0) {
+ default_fixed_font_size(0),
+ is_3d_supported(true) {
}
Preferences::Preferences(const WebPreferences& prefs)
@@ -19,7 +20,10 @@ Preferences::Preferences(const WebPreferences& prefs)
serif_font_family(prefs.serif_font_family),
sans_serif_font_family(prefs.sans_serif_font_family),
default_font_size(prefs.default_font_size),
- default_fixed_font_size(prefs.default_fixed_font_size) {
+ default_fixed_font_size(prefs.default_fixed_font_size),
+ // Pepper 3D support keys off of WebGL which is what the GPU blacklist
+ // is applied to.
+ is_3d_supported(prefs.experimental_webgl_enabled) {
}
Preferences::~Preferences() {
diff --git a/ppapi/shared_impl/ppapi_preferences.h b/ppapi/shared_impl/ppapi_preferences.h
index 8e0847c..497ea38 100644
--- a/ppapi/shared_impl/ppapi_preferences.h
+++ b/ppapi/shared_impl/ppapi_preferences.h
@@ -24,6 +24,8 @@ struct PPAPI_SHARED_EXPORT Preferences {
string16 sans_serif_font_family;
int default_font_size;
int default_fixed_font_size;
+
+ bool is_3d_supported;
};
} // namespace ppapi
diff --git a/ppapi/thunk/interfaces_ppb_private_flash.h b/ppapi/thunk/interfaces_ppb_private_flash.h
index 4f13d1c..e36f502 100644
--- a/ppapi/thunk/interfaces_ppb_private_flash.h
+++ b/ppapi/thunk/interfaces_ppb_private_flash.h
@@ -9,9 +9,6 @@
PROXIED_API(PPB_Flash)
PROXIED_IFACE(PPB_Flash,
- PPB_FLASH_INTERFACE_11_0,
- PPB_Flash_11)
-PROXIED_IFACE(PPB_Flash,
PPB_FLASH_INTERFACE_12_0,
PPB_Flash_12_0)
PROXIED_IFACE(PPB_Flash,
@@ -21,6 +18,10 @@ PROXIED_IFACE(PPB_Flash,
PPB_FLASH_INTERFACE_12_2,
PPB_Flash_12_2)
PROXIED_IFACE(PPB_Flash,
+ PPB_FLASH_INTERFACE_12_3,
+ PPB_Flash_12_3)
+
+PROXIED_IFACE(PPB_Flash,
PPB_FLASH_CLIPBOARD_INTERFACE_3_LEGACY,
PPB_Flash_Clipboard_3_0)
PROXIED_IFACE(PPB_Flash,
diff --git a/ppapi/thunk/ppb_flash_api.h b/ppapi/thunk/ppb_flash_api.h
index 1760480..3e1bf56 100644
--- a/ppapi/thunk/ppb_flash_api.h
+++ b/ppapi/thunk/ppb_flash_api.h
@@ -43,6 +43,8 @@ class PPAPI_THUNK_EXPORT PPB_Flash_API {
virtual int32_t InvokePrinting(PP_Instance instance) = 0;
virtual void UpdateActivity(PP_Instance instance) = 0;
virtual PP_Var GetDeviceID(PP_Instance instance) = 0;
+ virtual int32_t GetSettingInt(PP_Instance instance,
+ PP_FlashSetting setting) = 0;
// FlashClipboard.
virtual PP_Bool IsClipboardFormatAvailable(
diff --git a/ppapi/thunk/ppb_flash_thunk.cc b/ppapi/thunk/ppb_flash_thunk.cc
index 970cbac..4e004fb 100644
--- a/ppapi/thunk/ppb_flash_thunk.cc
+++ b/ppapi/thunk/ppb_flash_thunk.cc
@@ -43,22 +43,6 @@ PP_Bool DrawGlyphs(PP_Instance instance,
allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances);
}
-PP_Bool DrawGlyphs11(PP_Instance instance,
- PP_Resource pp_image_data,
- const PP_FontDescription_Dev* font_desc,
- uint32_t color,
- PP_Point position,
- PP_Rect clip,
- const float transformation[3][3],
- uint32_t glyph_count,
- const uint16_t glyph_indices[],
- const PP_Point glyph_advances[]) {
- // Backwards-compatible version. DrawGlyphs locks; no need to lock here.
- return DrawGlyphs(instance, pp_image_data, font_desc, color, &position,
- &clip, transformation, PP_TRUE, glyph_count, glyph_indices,
- glyph_advances);
-}
-
PP_Var GetProxyForURL(PP_Instance instance, const char* url) {
EnterInstance enter(instance);
if (enter.failed())
@@ -86,13 +70,6 @@ int32_t Navigate(PP_Resource request_id,
target, from_user_action);
}
-int32_t Navigate11(PP_Resource request_id,
- const char* target,
- bool from_user_action) {
- // Backwards-compatible version. Navigate locks; no need to lock here.
- return Navigate(request_id, target, PP_FromBool(from_user_action));
-}
-
void RunMessageLoop(PP_Instance instance) {
EnterInstance enter(instance);
if (enter.failed())
@@ -155,16 +132,12 @@ PP_Var GetDeviceID(PP_Instance instance) {
return enter.functions()->GetFlashAPI()->GetDeviceID(instance);
}
-const PPB_Flash_11 g_ppb_flash_11_thunk = {
- &SetInstanceAlwaysOnTop,
- &DrawGlyphs11,
- &GetProxyForURL,
- &Navigate11,
- &RunMessageLoop,
- &QuitMessageLoop,
- &GetLocalTimeZoneOffset,
- &GetCommandLineArgs
-};
+int32_t GetSettingInt(PP_Instance instance, PP_FlashSetting setting) {
+ EnterInstance enter(instance);
+ if (enter.failed())
+ return -1;
+ return enter.functions()->GetFlashAPI()->GetSettingInt(instance, setting);
+}
const PPB_Flash_12_0 g_ppb_flash_12_0_thunk = {
&SetInstanceAlwaysOnTop,
@@ -209,11 +182,24 @@ const PPB_Flash_12_2 g_ppb_flash_12_2_thunk = {
&GetDeviceID
};
-} // namespace
+const PPB_Flash_12_3 g_ppb_flash_12_3_thunk = {
+ &SetInstanceAlwaysOnTop,
+ &DrawGlyphs,
+ &GetProxyForURL,
+ &Navigate,
+ &RunMessageLoop,
+ &QuitMessageLoop,
+ &GetLocalTimeZoneOffset,
+ &GetCommandLineArgs,
+ &PreLoadFontWin,
+ &IsRectTopmost,
+ &InvokePrinting,
+ &UpdateActivity,
+ &GetDeviceID,
+ &GetSettingInt
+};
-const PPB_Flash_11* GetPPB_Flash_11_Thunk() {
- return &g_ppb_flash_11_thunk;
-}
+} // namespace
const PPB_Flash_12_0* GetPPB_Flash_12_0_Thunk() {
return &g_ppb_flash_12_0_thunk;
@@ -227,5 +213,9 @@ const PPB_Flash_12_2* GetPPB_Flash_12_2_Thunk() {
return &g_ppb_flash_12_2_thunk;
}
+const PPB_Flash_12_3* GetPPB_Flash_12_3_Thunk() {
+ return &g_ppb_flash_12_3_thunk;
+}
+
} // namespace thunk
} // namespace ppapi
diff --git a/ppapi/thunk/ppb_graphics_3d_thunk.cc b/ppapi/thunk/ppb_graphics_3d_thunk.cc
index 2c7bd50..edc19ca 100644
--- a/ppapi/thunk/ppb_graphics_3d_thunk.cc
+++ b/ppapi/thunk/ppb_graphics_3d_thunk.cc
@@ -16,7 +16,7 @@ namespace {
typedef EnterResource<PPB_Graphics3D_API> EnterGraphics3D;
-int32_t GetAttribMaxValue(PP_Resource instance,
+int32_t GetAttribMaxValue(PP_Instance instance,
int32_t attribute,
int32_t* value) {
// TODO(alokp): Implement me.