summaryrefslogtreecommitdiffstats
path: root/ppapi/example
diff options
context:
space:
mode:
authorddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 22:10:36 +0000
committerddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 22:10:36 +0000
commitf8502681d0b8feedc74ad467364eb72d185b5856 (patch)
tree81c23437debc57c0f9f0a405052ef21b21a60655 /ppapi/example
parent5c461ad29c4887f95c94e5a167963c96492291a2 (diff)
downloadchromium_src-f8502681d0b8feedc74ad467364eb72d185b5856.zip
chromium_src-f8502681d0b8feedc74ad467364eb72d185b5856.tar.gz
chromium_src-f8502681d0b8feedc74ad467364eb72d185b5856.tar.bz2
Added plugin size to error logging and a logging statement when the plugin size changes.
I found these changes useful while debugging issues when modifying the plugin. BUG=none TEST=none Review URL: http://codereview.chromium.org/6214007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/example')
-rw-r--r--ppapi/example/example.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/ppapi/example/example.cc b/ppapi/example/example.cc
index e875a4b..dc0230c 100644
--- a/ppapi/example/example.cc
+++ b/ppapi/example/example.cc
@@ -203,7 +203,7 @@ class MyInstance : public pp::Instance, public MyFetcherClient {
pp::ImageData image(this, PP_IMAGEDATAFORMAT_BGRA_PREMUL,
pp::Size(width, height), false);
if (image.is_null()) {
- printf("Couldn't allocate the image data\n");
+ printf("Couldn't allocate the image data: %d, %d\n", width, height);
return image;
}
@@ -218,6 +218,7 @@ class MyInstance : public pp::Instance, public MyFetcherClient {
}
}
+ // Draw the orbiting box.
float radians = static_cast<float>(animation_counter_) / kStepsPerCircle *
2 * 3.14159265358979F;
@@ -225,7 +226,8 @@ class MyInstance : public pp::Instance, public MyFetcherClient {
int x = static_cast<int>(cos(radians) * radius + radius + 2);
int y = static_cast<int>(sin(radians) * radius + radius + 2);
- FillRect(&image, x - 3, y - 3, 7, 7, 0x80000000);
+ const uint32_t box_bgra = 0x80000000; // Alpha 50%.
+ FillRect(&image, x - 3, y - 3, 7, 7, box_bgra);
return image;
}
@@ -234,6 +236,8 @@ class MyInstance : public pp::Instance, public MyFetcherClient {
if (!image.is_null()) {
device_context_.ReplaceContents(&image);
device_context_.Flush(pp::CompletionCallback(&FlushCallback, this));
+ } else {
+ printf("NullImage: %d, %d\n", width_, height_);
}
}
@@ -244,6 +248,8 @@ class MyInstance : public pp::Instance, public MyFetcherClient {
width_ = position.size().width();
height_ = position.size().height();
+ printf("DidChangeView relevant change: width=%d height:%d\n",
+ width_, height_);
device_context_ = pp::Graphics2D(this, pp::Size(width_, height_), false);
if (!BindGraphics(device_context_)) {