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

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

Issue 20987009: Rename PepperPluginDelegateImpl to PepperHelperImpl after getting rid of the PluginDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
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/ppb_image_data_impl.h" 5 #include "content/renderer/pepper/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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 ImageDataSimpleBackend::~ImageDataSimpleBackend() { 249 ImageDataSimpleBackend::~ImageDataSimpleBackend() {
250 } 250 }
251 251
252 bool ImageDataSimpleBackend::Init(PPB_ImageData_Impl* impl, 252 bool ImageDataSimpleBackend::Init(PPB_ImageData_Impl* impl,
253 PP_ImageDataFormat format, 253 PP_ImageDataFormat format,
254 int width, int height, 254 int width, int height,
255 bool init_to_zero) { 255 bool init_to_zero) {
256 skia_bitmap_.setConfig(SkBitmap::kARGB_8888_Config, 256 skia_bitmap_.setConfig(SkBitmap::kARGB_8888_Config,
257 impl->width(), impl->height()); 257 impl->width(), impl->height());
258 PepperPluginDelegateImpl* plugin_delegate = 258 PepperHelperImpl* plugin_delegate = ResourceHelper::GetHelper(impl);
259 ResourceHelper::GetPluginDelegate(impl);
260 if (!plugin_delegate) 259 if (!plugin_delegate)
261 return false; 260 return false;
262 shared_memory_.reset(RenderThread::Get()->HostAllocateSharedMemoryBuffer( 261 shared_memory_.reset(RenderThread::Get()->HostAllocateSharedMemoryBuffer(
263 skia_bitmap_.getSize()).release()); 262 skia_bitmap_.getSize()).release());
264 return !!shared_memory_.get(); 263 return !!shared_memory_.get();
265 } 264 }
266 265
267 bool ImageDataSimpleBackend::IsMapped() const { 266 bool ImageDataSimpleBackend::IsMapped() const {
268 return map_count_ > 0; 267 return map_count_ > 0;
269 } 268 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 return skia_canvas_.get(); 312 return skia_canvas_.get();
314 } 313 }
315 314
316 const SkBitmap* ImageDataSimpleBackend::GetMappedBitmap() const { 315 const SkBitmap* ImageDataSimpleBackend::GetMappedBitmap() const {
317 if (!IsMapped()) 316 if (!IsMapped())
318 return NULL; 317 return NULL;
319 return &skia_bitmap_; 318 return &skia_bitmap_;
320 } 319 }
321 320
322 } // namespace content 321 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/ppb_file_ref_impl.cc ('k') | content/renderer/pepper/ppb_tcp_server_socket_private_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698