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

Unified Diff: content/renderer/pepper/ppb_image_data_impl.h

Issue 61813003: Allow PPB_ImageData_Impl to be created in a way that is compatible with unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « content/renderer/pepper/pepper_graphics_2d_host.cc ('k') | content/renderer/pepper/ppb_image_data_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/ppb_image_data_impl.h
diff --git a/content/renderer/pepper/ppb_image_data_impl.h b/content/renderer/pepper/ppb_image_data_impl.h
index a16bbfa104b2a9cd9d06a5bffab82dbb8ba57383..49c399b1d3961852548ad2502aa1984053b00536 100644
--- a/content/renderer/pepper/ppb_image_data_impl.h
+++ b/content/renderer/pepper/ppb_image_data_impl.h
@@ -54,6 +54,11 @@ class CONTENT_EXPORT PPB_ImageData_Impl
PPB_ImageData_Impl(PP_Instance instance,
PPB_ImageData_Shared::ImageDataType type);
+ // Constructor used for unittests. The ImageData is always allocated locally.
+ struct ForTest {};
+ PPB_ImageData_Impl(PP_Instance instance,
+ ForTest);
+
bool Init(PP_ImageDataFormat format,
int width, int height,
bool init_to_zero);
@@ -102,7 +107,9 @@ class CONTENT_EXPORT PPB_ImageData_Impl
class ImageDataPlatformBackend : public PPB_ImageData_Impl::Backend {
public:
- ImageDataPlatformBackend();
+ // |is_browser_allocated| indicates whether the backing shared memory should
+ // be allocated by the browser process.
+ ImageDataPlatformBackend(bool is_browser_allocated);
virtual ~ImageDataPlatformBackend();
// PPB_ImageData_Impl::Backend implementation.
@@ -124,6 +131,8 @@ class ImageDataPlatformBackend : public PPB_ImageData_Impl::Backend {
int height_;
scoped_ptr<TransportDIB> dib_;
+ bool is_browser_allocated_;
+
// When the device is mapped, this is the image. Null when umapped.
scoped_ptr<SkCanvas> mapped_canvas_;
« no previous file with comments | « content/renderer/pepper/pepper_graphics_2d_host.cc ('k') | content/renderer/pepper/ppb_image_data_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698