Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_CPP_IMAGE_DATA_H_ | 5 #ifndef PPAPI_CPP_IMAGE_DATA_H_ |
| 6 #define PPAPI_CPP_IMAGE_DATA_H_ | 6 #define PPAPI_CPP_IMAGE_DATA_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/ppb_image_data.h" | 8 #include "ppapi/c/ppb_image_data.h" |
| 9 #include "ppapi/cpp/point.h" | 9 #include "ppapi/cpp/point.h" |
| 10 #include "ppapi/cpp/rect.h" | |
| 11 #include "ppapi/cpp/resource.h" | |
| 10 #include "ppapi/cpp/size.h" | 12 #include "ppapi/cpp/size.h" |
| 11 #include "ppapi/cpp/resource.h" | |
| 12 | 13 |
| 13 /// @file | 14 /// @file |
| 14 /// This file defines the APIs for determining how a browser | 15 /// This file defines the APIs for determining how a browser |
| 15 /// handles image data. | 16 /// handles image data. |
| 16 namespace pp { | 17 namespace pp { |
| 17 | 18 |
| 18 class InstanceHandle; | 19 class InstanceHandle; |
| 19 | 20 |
| 20 class ImageData : public Resource { | 21 class ImageData : public Resource { |
| 21 public: | 22 public: |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 | 123 |
| 123 /// This function is used retrieve the address of the given pixel for 32-bit | 124 /// This function is used retrieve the address of the given pixel for 32-bit |
| 124 /// pixel formats. | 125 /// pixel formats. |
| 125 /// | 126 /// |
| 126 /// @param[in] coord A <code>Point</code> representing the x and y | 127 /// @param[in] coord A <code>Point</code> representing the x and y |
| 127 /// coordinates for a specific pixel. | 128 /// coordinates for a specific pixel. |
| 128 /// | 129 /// |
| 129 /// @return The address for the pixel. | 130 /// @return The address for the pixel. |
| 130 uint32_t* GetAddr32(const Point& coord); | 131 uint32_t* GetAddr32(const Point& coord); |
| 131 | 132 |
| 133 /// This function determines if a rectangle's dimensions are fully contained | |
| 134 /// within the boundaries of the image. | |
| 135 /// | |
| 136 /// @param[in] rect A <code>Rect</code> representing the rectangle to check. | |
| 137 /// | |
| 138 /// @return True if fully contained, false otherwise. | |
| 139 bool Contains(const pp::Rect& rect) const; | |
|
raymes
2014/09/01 00:42:17
Technically this is a change to the public API. We
| |
| 140 | |
| 132 private: | 141 private: |
| 133 void InitData(); | 142 void InitData(); |
| 134 | 143 |
| 135 PP_ImageDataDesc desc_; | 144 PP_ImageDataDesc desc_; |
| 136 void* data_; | 145 void* data_; |
| 137 }; | 146 }; |
| 138 | 147 |
| 139 } // namespace pp | 148 } // namespace pp |
| 140 | 149 |
| 141 #endif // PPAPI_CPP_IMAGE_DATA_H_ | 150 #endif // PPAPI_CPP_IMAGE_DATA_H_ |
| OLD | NEW |