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

Unified Diff: ppapi/proxy/ppb_graphics_2d_proxy.cc

Issue 10544168: Implement HiDPI support in Pepper dev interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
Index: ppapi/proxy/ppb_graphics_2d_proxy.cc
diff --git a/ppapi/proxy/ppb_graphics_2d_proxy.cc b/ppapi/proxy/ppb_graphics_2d_proxy.cc
index 0cbd3885af2dc51b4ea8a9a561c6d887f7b84e60..9957df20bf414e6770a227a02bc17e1729a5ad10 100644
--- a/ppapi/proxy/ppb_graphics_2d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_2d_proxy.cc
@@ -29,7 +29,8 @@ class Graphics2D : public Resource, public thunk::PPB_Graphics2D_API {
public:
Graphics2D(const HostResource& host_resource,
const PP_Size& size,
- PP_Bool is_always_opaque);
+ PP_Bool is_always_opaque,
+ float scale);
virtual ~Graphics2D();
// Resource.
@@ -57,6 +58,7 @@ class Graphics2D : public Resource, public thunk::PPB_Graphics2D_API {
PP_Size size_;
PP_Bool is_always_opaque_;
+ float scale_;
// In the plugin, this is the current callback set for Flushes. When the
// pointer is non-NULL, we're waiting for a flush ACK.
@@ -67,10 +69,12 @@ class Graphics2D : public Resource, public thunk::PPB_Graphics2D_API {
Graphics2D::Graphics2D(const HostResource& host_resource,
const PP_Size& size,
- PP_Bool is_always_opaque)
+ PP_Bool is_always_opaque,
+ float scale)
: Resource(OBJECT_IS_PROXY, host_resource),
size_(size),
- is_always_opaque_(is_always_opaque) {
+ is_always_opaque_(is_always_opaque),
+ scale_(scale) {
}
Graphics2D::~Graphics2D() {
@@ -157,17 +161,19 @@ PPB_Graphics2D_Proxy::~PPB_Graphics2D_Proxy() {
PP_Resource PPB_Graphics2D_Proxy::CreateProxyResource(
PP_Instance instance,
const PP_Size& size,
- PP_Bool is_always_opaque) {
+ PP_Bool is_always_opaque,
+ float scale) {
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
if (!dispatcher)
return 0;
HostResource result;
dispatcher->Send(new PpapiHostMsg_PPBGraphics2D_Create(
- kApiID, instance, size, is_always_opaque, &result));
+ kApiID, instance, size, is_always_opaque, scale, &result));
if (result.is_null())
return 0;
- return (new Graphics2D(result, size, is_always_opaque))->GetReference();
+ return (new Graphics2D(result, size, is_always_opaque, scale))
+ ->GetReference();
}
bool PPB_Graphics2D_Proxy::OnMessageReceived(const IPC::Message& msg) {
@@ -195,11 +201,12 @@ bool PPB_Graphics2D_Proxy::OnMessageReceived(const IPC::Message& msg) {
void PPB_Graphics2D_Proxy::OnHostMsgCreate(PP_Instance instance,
const PP_Size& size,
PP_Bool is_always_opaque,
+ float scale,
HostResource* result) {
thunk::EnterResourceCreation enter(instance);
if (enter.succeeded()) {
result->SetHostResource(instance, enter.functions()->CreateGraphics2D(
- instance, size, is_always_opaque));
+ instance, size, is_always_opaque, scale));
}
}

Powered by Google App Engine
This is Rietveld 408576698