Index: ppapi/cpp/image_data.cc |
diff --git a/ppapi/cpp/image_data.cc b/ppapi/cpp/image_data.cc |
index d9738964795eb698d8d612a1b2964f1164594415..90b7c97ab814657da61d28b08ee1d549252c62a0 100644 |
--- a/ppapi/cpp/image_data.cc |
+++ b/ppapi/cpp/image_data.cc |
@@ -74,6 +74,11 @@ uint32_t* ImageData::GetAddr32(const Point& coord) { |
&static_cast<char*>(data())[coord.y() * stride() + coord.x() * 4]); |
} |
+bool ImageData::Contains(const pp::Rect& rect) const { |
+ return rect.width() >= 0 && rect.height() >= 0 && |
+ pp::Rect(size()).Contains(rect); |
+} |
+ |
// static |
bool ImageData::IsImageDataFormatSupported(PP_ImageDataFormat format) { |
if (!has_interface<PPB_ImageData_1_0>()) |