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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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() OVERRIDE; | 58 virtual ::ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API() OVERRIDE; |
59 | 59 |
60 // Resource overrides. | |
61 virtual ImageData* AsImageData() OVERRIDE; | |
62 | |
63 // PPB_ImageData API. | 60 // PPB_ImageData API. |
64 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; | 61 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; |
65 virtual void* Map() OVERRIDE; | 62 virtual void* Map() OVERRIDE; |
66 virtual void Unmap() OVERRIDE; | 63 virtual void Unmap() OVERRIDE; |
67 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; | 64 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; |
68 | 65 |
69 skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } | 66 skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } |
70 | 67 |
71 const PP_ImageDataDesc& desc() const { return desc_; } | 68 const PP_ImageDataDesc& desc() const { return desc_; } |
72 | 69 |
73 static const ImageHandle NullHandle; | 70 static const ImageHandle NullHandle; |
74 static ImageHandle HandleFromInt(int32_t i); | 71 static ImageHandle HandleFromInt(int32_t i); |
75 | 72 |
76 private: | 73 private: |
77 PP_ImageDataDesc desc_; | 74 PP_ImageDataDesc desc_; |
78 | 75 |
79 scoped_ptr<TransportDIB> transport_dib_; | 76 scoped_ptr<TransportDIB> transport_dib_; |
80 | 77 |
81 // Null when the image isn't mapped. | 78 // Null when the image isn't mapped. |
82 scoped_ptr<skia::PlatformCanvas> mapped_canvas_; | 79 scoped_ptr<skia::PlatformCanvas> mapped_canvas_; |
83 | 80 |
84 DISALLOW_COPY_AND_ASSIGN(ImageData); | 81 DISALLOW_COPY_AND_ASSIGN(ImageData); |
85 }; | 82 }; |
86 | 83 |
87 } // namespace proxy | 84 } // namespace proxy |
88 } // namespace pp | 85 } // namespace pp |
89 | 86 |
90 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 87 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
OLD | NEW |