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

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

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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 3068 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_graphics_2d_host.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