| 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_PPB_IMAGE_DATA_PROXY_H_ | 5 #ifndef PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
| 6 #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 6 #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
| 10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 class ImageData : public PluginResource, | 48 class ImageData : public PluginResource, |
| 49 public ::ppapi::thunk::PPB_ImageData_API, | 49 public ::ppapi::thunk::PPB_ImageData_API, |
| 50 public ppapi::ImageDataImpl { | 50 public ppapi::ImageDataImpl { |
| 51 public: | 51 public: |
| 52 ImageData(const HostResource& resource, | 52 ImageData(const HostResource& resource, |
| 53 const PP_ImageDataDesc& desc, | 53 const PP_ImageDataDesc& desc, |
| 54 ImageHandle handle); | 54 ImageHandle handle); |
| 55 virtual ~ImageData(); | 55 virtual ~ImageData(); |
| 56 | 56 |
| 57 // ResourceObjectBase overrides. | 57 // ResourceObjectBase overrides. |
| 58 virtual ::ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API(); | 58 virtual ::ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API() OVERRIDE; |
| 59 | 59 |
| 60 // Resource overrides. | 60 // Resource overrides. |
| 61 virtual ImageData* AsImageData(); | 61 virtual ImageData* AsImageData() OVERRIDE; |
| 62 | 62 |
| 63 // PPB_ImageData API. | 63 // PPB_ImageData API. |
| 64 virtual PP_Bool Describe(PP_ImageDataDesc* desc); | 64 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; |
| 65 virtual void* Map(); | 65 virtual void* Map() OVERRIDE; |
| 66 virtual void Unmap(); | 66 virtual void Unmap() OVERRIDE; |
| 67 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; |
| 67 | 68 |
| 68 skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } | 69 skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } |
| 69 | 70 |
| 70 const PP_ImageDataDesc& desc() const { return desc_; } | 71 const PP_ImageDataDesc& desc() const { return desc_; } |
| 71 | 72 |
| 72 static const ImageHandle NullHandle; | 73 static const ImageHandle NullHandle; |
| 73 static ImageHandle HandleFromInt(int32_t i); | 74 static ImageHandle HandleFromInt(int32_t i); |
| 74 | 75 |
| 75 private: | 76 private: |
| 76 PP_ImageDataDesc desc_; | 77 PP_ImageDataDesc desc_; |
| 77 | 78 |
| 78 scoped_ptr<TransportDIB> transport_dib_; | 79 scoped_ptr<TransportDIB> transport_dib_; |
| 79 | 80 |
| 80 // Null when the image isn't mapped. | 81 // Null when the image isn't mapped. |
| 81 scoped_ptr<skia::PlatformCanvas> mapped_canvas_; | 82 scoped_ptr<skia::PlatformCanvas> mapped_canvas_; |
| 82 | 83 |
| 83 DISALLOW_COPY_AND_ASSIGN(ImageData); | 84 DISALLOW_COPY_AND_ASSIGN(ImageData); |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 } // namespace proxy | 87 } // namespace proxy |
| 87 } // namespace pp | 88 } // namespace pp |
| 88 | 89 |
| 89 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 90 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
| OLD | NEW |