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

Side by Side Diff: webkit/plugins/ppapi/ppb_image_data_impl.h

Issue 16605006: Clean up Pepper ImageData resource class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Linux, allow both kinds of ImageData on host side. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_
6 #define WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "ppapi/c/ppb_image_data.h" 10 #include "ppapi/c/ppb_image_data.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 bool init_to_zero); 56 bool init_to_zero);
57 57
58 // Create an ImageData backed by a PlatformCanvas. You must use this if you 58 // Create an ImageData backed by a PlatformCanvas. You must use this if you
59 // intend the ImageData to be usable in platform-specific APIs (like font 59 // intend the ImageData to be usable in platform-specific APIs (like font
60 // rendering or rendering widgets like scrollbars). 60 // rendering or rendering widgets like scrollbars).
61 static PP_Resource CreatePlatform(PP_Instance pp_instance, 61 static PP_Resource CreatePlatform(PP_Instance pp_instance,
62 PP_ImageDataFormat format, 62 PP_ImageDataFormat format,
63 const PP_Size& size, 63 const PP_Size& size,
64 PP_Bool init_to_zero); 64 PP_Bool init_to_zero);
65 65
66 // Use this to create an ImageData for use with NaCl. This is backed by a 66 // Use this to create an ImageData when access to the platform-specific canvas
67 // simple shared memory buffer. 67 // isn't required. This is backed by a simple shared memory buffer. This is
68 static PP_Resource CreateNaCl(PP_Instance pp_instance, 68 // the only kind of ImageData that can be used by NaCl plugins.
69 PP_ImageDataFormat format, 69 static PP_Resource CreateSimple(PP_Instance pp_instance,
70 const PP_Size& size, 70 PP_ImageDataFormat format,
71 PP_Bool init_to_zero); 71 const PP_Size& size,
72 PP_Bool init_to_zero);
72 73
73 int width() const { return width_; } 74 int width() const { return width_; }
74 int height() const { return height_; } 75 int height() const { return height_; }
75 76
76 // Returns the image format. 77 // Returns the image format.
77 PP_ImageDataFormat format() const { return format_; } 78 PP_ImageDataFormat format() const { return format_; }
78 79
79 // Returns true if this image is mapped. False means that the image is either 80 // Returns true if this image is mapped. False means that the image is either
80 // invalid or not mapped. See ImageDataAutoMapper below. 81 // invalid or not mapped. See ImageDataAutoMapper below.
81 bool IsMapped() const; 82 bool IsMapped() const;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 bool is_valid_; 196 bool is_valid_;
196 bool needs_unmap_; 197 bool needs_unmap_;
197 198
198 DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper); 199 DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper);
199 }; 200 };
200 201
201 } // namespace ppapi 202 } // namespace ppapi
202 } // namespace webkit 203 } // namespace webkit
203 204
204 #endif // WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_ 205 #endif // WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698