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

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

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.h
diff --git a/remoting/client/plugin/pepper_image_buffer.h b/remoting/client/plugin/pepper_image_buffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..734125862fff0d153f4ad4ee835a53aa54827697
--- /dev/null
+++ b/remoting/client/plugin/pepper_image_buffer.h
@@ -0,0 +1,37 @@
+#ifndef REMOTING_CLIENT_PLUGIN_PEPPER_IMAGE_BUFFER_H_
+#define REMOTING_CLIENT_PLUGIN_PEPPER_IMAGE_BUFFER_H_
+
+#include "remoting/client/image_buffer.h"
+
+#include "ppapi/cpp/image_data.h"
+#include "ppapi/cpp/size.h"
+
+namespace remoting {
+
+// ImageBuffer that uses PPAPI to allocate space for a raw image.
+class PepperImageBuffer : public ImageBuffer {
+ public:
+ // Constructor.
+ PepperImageBuffer(const pp::InstanceHandle& instance, int width, int height);
+
+ // ImageBuffer implementation:
+ virtual bool is_null() OVERRIDE;
+ virtual uint8* data() OVERRIDE;
+ virtual int width() OVERRIDE;
+ virtual int height() OVERRIDE;
+ virtual int32 stride() OVERRIDE;
+
+ // Provides access to the underlying PPAPI object.
+ const pp::ImageData& data_object();
+
+ private:
+ // Size of the image (used only for construction of data_).
+ pp::Size size_;
+
+ // Underlying PPAPI image that's actually responsible for everything.
+ pp::ImageData data_;
+};
+
+} // namespace remoting
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698