| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 const PP_Size& size, | 69 const PP_Size& size, |
| 70 PP_Bool init_to_zero) { | 70 PP_Bool init_to_zero) { |
| 71 scoped_refptr<PPB_ImageData_Impl> | 71 scoped_refptr<PPB_ImageData_Impl> |
| 72 data(new PPB_ImageData_Impl(instance, PLATFORM)); | 72 data(new PPB_ImageData_Impl(instance, PLATFORM)); |
| 73 if (!data->Init(format, size.width, size.height, !!init_to_zero)) | 73 if (!data->Init(format, size.width, size.height, !!init_to_zero)) |
| 74 return 0; | 74 return 0; |
| 75 return data->GetReference(); | 75 return data->GetReference(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 // static | 78 // static |
| 79 PP_Resource PPB_ImageData_Impl::CreateNaCl(PP_Instance instance, | 79 PP_Resource PPB_ImageData_Impl::CreateSimple(PP_Instance instance, |
| 80 PP_ImageDataFormat format, | 80 PP_ImageDataFormat format, |
| 81 const PP_Size& size, | 81 const PP_Size& size, |
| 82 PP_Bool init_to_zero) { | 82 PP_Bool init_to_zero) { |
| 83 scoped_refptr<PPB_ImageData_Impl> | 83 scoped_refptr<PPB_ImageData_Impl> |
| 84 data(new PPB_ImageData_Impl(instance, NACL)); | 84 data(new PPB_ImageData_Impl(instance, NACL)); |
| 85 if (!data->Init(format, size.width, size.height, !!init_to_zero)) | 85 if (!data->Init(format, size.width, size.height, !!init_to_zero)) |
| 86 return 0; | 86 return 0; |
| 87 return data->GetReference(); | 87 return data->GetReference(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 PPB_ImageData_API* PPB_ImageData_Impl::AsPPB_ImageData_API() { | 90 PPB_ImageData_API* PPB_ImageData_Impl::AsPPB_ImageData_API() { |
| 91 return this; | 91 return this; |
| 92 } | 92 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 | 282 |
| 283 const SkBitmap* ImageDataNaClBackend::GetMappedBitmap() const { | 283 const SkBitmap* ImageDataNaClBackend::GetMappedBitmap() const { |
| 284 if (!IsMapped()) | 284 if (!IsMapped()) |
| 285 return NULL; | 285 return NULL; |
| 286 return &skia_bitmap_; | 286 return &skia_bitmap_; |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace ppapi | 289 } // namespace ppapi |
| 290 } // namespace webkit | 290 } // namespace webkit |
| OLD | NEW |