summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 21:48:36 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-22 21:48:36 +0000
commit6328a5b2c36c0067b365a702946a4fbd60577f5d (patch)
tree4670d40fe14ca6ad1935ab8e948e4f7f7f882b97 /webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
parentb90c049fca689d466610cecbdbfe9a9935d4e8cf (diff)
downloadchromium_src-6328a5b2c36c0067b365a702946a4fbd60577f5d.zip
chromium_src-6328a5b2c36c0067b365a702946a4fbd60577f5d.tar.gz
chromium_src-6328a5b2c36c0067b365a702946a4fbd60577f5d.tar.bz2
Minor cleanup of resource creation. This eliminates a bunch of copy-and-paste
code for determining the instance for every request, and also removes a bunch of unnecessary Create() functions for simple resources. TEST=none BUG=none Review URL: http://codereview.chromium.org/7233005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_graphics_2d_impl.cc')
-rw-r--r--webkit/plugins/ppapi/ppb_graphics_2d_impl.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
index b8f148a..caf3821 100644
--- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
@@ -163,6 +163,19 @@ PPB_Graphics2D_Impl::~PPB_Graphics2D_Impl() {
}
// static
+PP_Resource PPB_Graphics2D_Impl::Create(PluginInstance* instance,
+ const PP_Size& size,
+ PP_Bool is_always_opaque) {
+ scoped_refptr<PPB_Graphics2D_Impl> graphics_2d(
+ new PPB_Graphics2D_Impl(instance));
+ if (!graphics_2d->Init(size.width, size.height,
+ PPBoolToBool(is_always_opaque))) {
+ return 0;
+ }
+ return graphics_2d->GetReference();
+}
+
+// static
const PPB_Graphics2D* PPB_Graphics2D_Impl::GetInterface() {
return ::ppapi::thunk::GetPPB_Graphics2D_Thunk();
}