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_)) { |