| 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 "content/renderer/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bit_cast.h" | 10 #include "base/bit_cast.h" |
| (...skipping 3068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3079 image_skia_rep.pixel_width(), | 3079 image_skia_rep.pixel_width(), |
| 3080 image_skia_rep.pixel_height(), | 3080 image_skia_rep.pixel_height(), |
| 3081 false)) { | 3081 false)) { |
| 3082 return 0; | 3082 return 0; |
| 3083 } | 3083 } |
| 3084 | 3084 |
| 3085 ImageDataAutoMapper mapper(image_data.get()); | 3085 ImageDataAutoMapper mapper(image_data.get()); |
| 3086 if (!mapper.is_valid()) | 3086 if (!mapper.is_valid()) |
| 3087 return 0; | 3087 return 0; |
| 3088 | 3088 |
| 3089 SkCanvas* canvas = image_data->GetPlatformCanvas(); | 3089 CdlCanvas* canvas = image_data->GetPlatformCanvas(); |
| 3090 // Note: Do not SkBitmap::copyTo the canvas bitmap directly because it will | 3090 // Note: Do not SkBitmap::copyTo the canvas bitmap directly because it will |
| 3091 // ignore the allocated pixels in shared memory and re-allocate a new buffer. | 3091 // ignore the allocated pixels in shared memory and re-allocate a new buffer. |
| 3092 canvas->writePixels(image_skia_rep.sk_bitmap(), 0, 0); | 3092 canvas->writePixels(image_skia_rep.sk_bitmap(), 0, 0); |
| 3093 | 3093 |
| 3094 return image_data->GetReference(); | 3094 return image_data->GetReference(); |
| 3095 } | 3095 } |
| 3096 | 3096 |
| 3097 PP_ExternalPluginResult PepperPluginInstanceImpl::SwitchToOutOfProcessProxy( | 3097 PP_ExternalPluginResult PepperPluginInstanceImpl::SwitchToOutOfProcessProxy( |
| 3098 const base::FilePath& file_path, | 3098 const base::FilePath& file_path, |
| 3099 ppapi::PpapiPermissions permissions, | 3099 ppapi::PpapiPermissions permissions, |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3456 const cc::TextureMailbox& mailbox) const { | 3456 const cc::TextureMailbox& mailbox) const { |
| 3457 auto it = | 3457 auto it = |
| 3458 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), | 3458 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), |
| 3459 [&mailbox](const TextureMailboxRefCount& ref_count) { | 3459 [&mailbox](const TextureMailboxRefCount& ref_count) { |
| 3460 return ref_count.first.mailbox() == mailbox.mailbox(); | 3460 return ref_count.first.mailbox() == mailbox.mailbox(); |
| 3461 }); | 3461 }); |
| 3462 return it != texture_ref_counts_.end(); | 3462 return it != texture_ref_counts_.end(); |
| 3463 } | 3463 } |
| 3464 | 3464 |
| 3465 } // namespace content | 3465 } // namespace content |
| OLD | NEW |