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

Unified Diff: remoting/client/plugin/pepper_image_buffer.cc

Issue 18233015: Abstract PPAPI's ImageData behind webrtc::DesktopFrame interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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
Index: remoting/client/plugin/pepper_image_buffer.cc
diff --git a/remoting/client/plugin/pepper_image_buffer.cc b/remoting/client/plugin/pepper_image_buffer.cc
new file mode 100644
index 0000000000000000000000000000000000000000..14eb95a2e9e7ad36eca86c7ffd4bcb14d30aab2a
--- /dev/null
+++ b/remoting/client/plugin/pepper_image_buffer.cc
@@ -0,0 +1,37 @@
+#include "remoting/client/plugin/pepper_image_buffer.h"
+
+using pp::ImageData;
+
+namespace remoting {
+
+PepperImageBuffer::PepperImageBuffer(const pp::InstanceHandle& instance,
+ int width,
+ int height)
+ : size_(width, height),
+ data_(instance, PP_IMAGEDATAFORMAT_BGRA_PREMUL, size_, false) {}
+
+bool PepperImageBuffer::is_null() {
+ return data_.is_null();
+}
+
+uint8* PepperImageBuffer::data() {
+ return reinterpret_cast<uint8*>(data_.data());
+}
+
+int PepperImageBuffer::width() {
+ return data_.size().width();
+}
+
+int PepperImageBuffer::height() {
+ return data_.size().height();
+}
+
+int32 PepperImageBuffer::stride() {
+ return data_.stride();
+}
+
+const ImageData& PepperImageBuffer::data_object() {
+ return data_;
+}
+
+} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698