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

Unified Diff: ppapi/example/example.cc

Issue 6214007: Added plugin size to error logging and a logging statement when the plugin size changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/example/example.cc
diff --git a/ppapi/example/example.cc b/ppapi/example/example.cc
index ab5a248b0b9b3a036413e07e05ab936c81fb1b43..146a1c7c0692e683a2aaa95a7443593c9f95b677 100644
--- a/ppapi/example/example.cc
+++ b/ppapi/example/example.cc
@@ -198,7 +198,7 @@ class MyInstance : public pp::Instance, public MyFetcherClient {
pp::ImageData image(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;
}
@@ -213,6 +213,7 @@ class MyInstance : public pp::Instance, public MyFetcherClient {
}
}
+ // Draw the orbiting box.
float radians = static_cast<float>(animation_counter_) / kStepsPerCircle *
2 * 3.14159265358979F;
@@ -220,7 +221,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;
}
@@ -229,6 +231,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_);
}
}
@@ -239,6 +243,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(pp::Size(width_, height_), false);
if (!BindGraphics(device_context_)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698