| 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 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 Loading... |
| 56 return platform_image_.get(); | 56 return platform_image_.get(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual ::ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API() OVERRIDE; | 59 virtual ::ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API() OVERRIDE; |
| 60 | 60 |
| 61 // PPB_ImageData_API implementation. | 61 // PPB_ImageData_API implementation. |
| 62 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; | 62 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; |
| 63 virtual void* Map() OVERRIDE; | 63 virtual void* Map() OVERRIDE; |
| 64 virtual void Unmap() OVERRIDE; | 64 virtual void Unmap() OVERRIDE; |
| 65 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; | 65 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; |
| 66 virtual skia::PlatformCanvas* GetPlatformCanvas() OVERRIDE; |
| 66 | 67 |
| 67 // The mapped bitmap and canvas will be NULL if the image is not mapped. | |
| 68 skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } | |
| 69 const SkBitmap* GetMappedBitmap() const; | 68 const SkBitmap* GetMappedBitmap() const; |
| 70 | 69 |
| 71 // Swaps the guts of this image data with another. | 70 // Swaps the guts of this image data with another. |
| 72 void Swap(PPB_ImageData_Impl* other); | 71 void Swap(PPB_ImageData_Impl* other); |
| 73 | 72 |
| 74 private: | 73 private: |
| 75 // This will be NULL before initialization, and if this PPB_ImageData_Impl is | 74 // This will be NULL before initialization, and if this PPB_ImageData_Impl is |
| 76 // swapped with another. | 75 // swapped with another. |
| 77 scoped_ptr<PluginDelegate::PlatformImage2D> platform_image_; | 76 scoped_ptr<PluginDelegate::PlatformImage2D> platform_image_; |
| 78 | 77 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 bool is_valid_; | 121 bool is_valid_; |
| 123 bool needs_unmap_; | 122 bool needs_unmap_; |
| 124 | 123 |
| 125 DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper); | 124 DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper); |
| 126 }; | 125 }; |
| 127 | 126 |
| 128 } // namespace ppapi | 127 } // namespace ppapi |
| 129 } // namespace webkit | 128 } // namespace webkit |
| 130 | 129 |
| 131 #endif // WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_ | 130 #endif // WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_ |
| OLD | NEW |