diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 16:32:30 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-06 16:32:30 +0000 |
commit | 34b43737cc9e993301528549cc2e17837e9c5674 (patch) | |
tree | eb31f7817f6c82bed3fd8ec9eb35e26c85a6a5c4 | |
parent | 579f2a1522db8ca46a8ed3807e268ac05c073cf4 (diff) | |
download | chromium_src-34b43737cc9e993301528549cc2e17837e9c5674.zip chromium_src-34b43737cc9e993301528549cc2e17837e9c5674.tar.gz chromium_src-34b43737cc9e993301528549cc2e17837e9c5674.tar.bz2 |
Fixing PPB_Graphics2D::Describe
BUG= http://code.google.com/p/chromium/issues/detail?id=78074
TEST= ppapi/tests/test_case.html?testcase=Graphics2D
Patch by Sang Ahn
Original Review http://codereview.chromium.org/6728034/
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80638 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ppapi/tests/test_graphics_2d.cc | 9 | ||||
-rw-r--r-- | webkit/DEPS | 1 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 3 |
3 files changed, 9 insertions, 4 deletions
diff --git a/ppapi/tests/test_graphics_2d.cc b/ppapi/tests/test_graphics_2d.cc index d0e3f20..f9bafc1 100644 --- a/ppapi/tests/test_graphics_2d.cc +++ b/ppapi/tests/test_graphics_2d.cc @@ -4,6 +4,7 @@ #include "ppapi/tests/test_graphics_2d.h" +#include <stdlib.h> #include <string.h> #include "ppapi/c/dev/ppb_testing_dev.h" @@ -293,18 +294,20 @@ std::string TestGraphics2D::TestInitToZero() { std::string TestGraphics2D::TestDescribe() { const int w = 15, h = 17; - pp::Graphics2D dc(instance_, pp::Size(w, h), false); + const bool always_opaque = ::rand() % 2 ? true : false; + pp::Graphics2D dc(instance_, pp::Size(w, h), always_opaque); if (dc.is_null()) return "Failure creating a boring device"; PP_Size size; size.width = -1; size.height = -1; - PP_Bool is_always_opaque = PP_TRUE; + PP_Bool is_always_opaque = PP_FALSE; if (!graphics_2d_interface_->Describe(dc.pp_resource(), &size, &is_always_opaque)) return "Describe failed"; - if (size.width != w || size.height != h || is_always_opaque != PP_FALSE) + if (size.width != w || size.height != h || + is_always_opaque != pp::BoolToPPBool(always_opaque)) return "Mismatch of data."; PASS(); diff --git a/webkit/DEPS b/webkit/DEPS index 6a2d299..66b7100 100644 --- a/webkit/DEPS +++ b/webkit/DEPS @@ -29,5 +29,6 @@ include_rules = [ "+net/test", "+net/url_request", "+net/websockets", + "+ppapi/cpp", "+third_party/npapi/bindings", ] diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc index 5e98f44..1bb83ee 100644 --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc @@ -14,6 +14,7 @@ #include "ppapi/c/pp_rect.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/ppb_graphics_2d.h" +#include "ppapi/cpp/common.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/gfx/blit.h" #include "ui/gfx/point.h" @@ -258,7 +259,7 @@ PP_Bool PPB_Graphics2D_Impl::Describe(PP_Size* size, PP_Bool* is_always_opaque) { size->width = image_data_->width(); size->height = image_data_->height(); - *is_always_opaque = PP_FALSE; // TODO(brettw) implement this. + *is_always_opaque = pp::BoolToPPBool(is_always_opaque_); return PP_TRUE; } |