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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Returns true if this image is mapped. False means that the image is either | 43 // Returns true if this image is mapped. False means that the image is either |
44 // invalid or not mapped. See ImageDataAutoMapper below. | 44 // invalid or not mapped. See ImageDataAutoMapper below. |
45 bool is_mapped() const { return !!mapped_canvas_.get(); } | 45 bool is_mapped() const { return !!mapped_canvas_.get(); } |
46 | 46 |
47 PluginDelegate::PlatformImage2D* platform_image() const { | 47 PluginDelegate::PlatformImage2D* platform_image() const { |
48 return platform_image_.get(); | 48 return platform_image_.get(); |
49 } | 49 } |
50 | 50 |
51 virtual ::ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API() OVERRIDE; | 51 virtual ::ppapi::thunk::PPB_ImageData_API* AsPPB_ImageData_API() OVERRIDE; |
52 | 52 |
53 // Resource overrides. | |
54 virtual PPB_ImageData_Impl* AsPPB_ImageData_Impl() OVERRIDE; | |
55 | |
56 // PPB_ImageData_API implementation. | 53 // PPB_ImageData_API implementation. |
57 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; | 54 virtual PP_Bool Describe(PP_ImageDataDesc* desc) OVERRIDE; |
58 virtual void* Map() OVERRIDE; | 55 virtual void* Map() OVERRIDE; |
59 virtual void Unmap() OVERRIDE; | 56 virtual void Unmap() OVERRIDE; |
60 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; | 57 virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) OVERRIDE; |
61 | 58 |
62 // The mapped bitmap and canvas will be NULL if the image is not mapped. | 59 // The mapped bitmap and canvas will be NULL if the image is not mapped. |
63 skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } | 60 skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } |
64 const SkBitmap* GetMappedBitmap() const; | 61 const SkBitmap* GetMappedBitmap() const; |
65 | 62 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 bool is_valid_; | 114 bool is_valid_; |
118 bool needs_unmap_; | 115 bool needs_unmap_; |
119 | 116 |
120 DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper); | 117 DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper); |
121 }; | 118 }; |
122 | 119 |
123 } // namespace ppapi | 120 } // namespace ppapi |
124 } // namespace webkit | 121 } // namespace webkit |
125 | 122 |
126 #endif // WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_ | 123 #endif // WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_ |
OLD | NEW |