Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2618373002: Remove PPB_ImageData_API::GetPlatformCanvas() (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/child/browser_font_resource_trusted.cc ('k') | content/renderer/pepper/ppb_image_data_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698