| 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 3076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3087 image_skia_rep.pixel_width(), | 3087 image_skia_rep.pixel_width(), |
| 3088 image_skia_rep.pixel_height(), | 3088 image_skia_rep.pixel_height(), |
| 3089 false)) { | 3089 false)) { |
| 3090 return 0; | 3090 return 0; |
| 3091 } | 3091 } |
| 3092 | 3092 |
| 3093 ImageDataAutoMapper mapper(image_data.get()); | 3093 ImageDataAutoMapper mapper(image_data.get()); |
| 3094 if (!mapper.is_valid()) | 3094 if (!mapper.is_valid()) |
| 3095 return 0; | 3095 return 0; |
| 3096 | 3096 |
| 3097 SkCanvas* canvas = image_data->GetPlatformCanvas(); | 3097 SkCanvas* canvas = image_data->GetCanvas(); |
| 3098 // Note: Do not SkBitmap::copyTo the canvas bitmap directly because it will | 3098 // Note: Do not SkBitmap::copyTo the canvas bitmap directly because it will |
| 3099 // ignore the allocated pixels in shared memory and re-allocate a new buffer. | 3099 // ignore the allocated pixels in shared memory and re-allocate a new buffer. |
| 3100 canvas->writePixels(image_skia_rep.sk_bitmap(), 0, 0); | 3100 canvas->writePixels(image_skia_rep.sk_bitmap(), 0, 0); |
| 3101 | 3101 |
| 3102 return image_data->GetReference(); | 3102 return image_data->GetReference(); |
| 3103 } | 3103 } |
| 3104 | 3104 |
| 3105 PP_ExternalPluginResult PepperPluginInstanceImpl::SwitchToOutOfProcessProxy( | 3105 PP_ExternalPluginResult PepperPluginInstanceImpl::SwitchToOutOfProcessProxy( |
| 3106 const base::FilePath& file_path, | 3106 const base::FilePath& file_path, |
| 3107 ppapi::PpapiPermissions permissions, | 3107 ppapi::PpapiPermissions permissions, |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3464 const cc::TextureMailbox& mailbox) const { | 3464 const cc::TextureMailbox& mailbox) const { |
| 3465 auto it = | 3465 auto it = |
| 3466 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), | 3466 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), |
| 3467 [&mailbox](const TextureMailboxRefCount& ref_count) { | 3467 [&mailbox](const TextureMailboxRefCount& ref_count) { |
| 3468 return ref_count.first.mailbox() == mailbox.mailbox(); | 3468 return ref_count.first.mailbox() == mailbox.mailbox(); |
| 3469 }); | 3469 }); |
| 3470 return it != texture_ref_counts_.end(); | 3470 return it != texture_ref_counts_.end(); |
| 3471 } | 3471 } |
| 3472 | 3472 |
| 3473 } // namespace content | 3473 } // namespace content |
| OLD | NEW |