| Index: webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
| diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
| index ddfea5ffd621ca3563373029e3a730f97df1424f..c1d3956cabd1e955d4ebfc91bf2cd9150da5d8de 100644
|
| --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
| +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
|
| @@ -89,8 +89,10 @@ void ConvertBetweenBGRAandRGBA(const uint32_t* input,
|
| // Converts ImageData from PP_IMAGEDATAFORMAT_BGRA_PREMUL to
|
| // PP_IMAGEDATAFORMAT_RGBA_PREMUL, or reverse. It's assumed that the
|
| // destination image is always mapped (so will have non-NULL data).
|
| -void ConvertImageData(PPB_ImageData_Impl* src_image, const SkIRect& src_rect,
|
| - PPB_ImageData_Impl* dest_image, const SkRect& dest_rect) {
|
| +void ConvertImageData(scoped_refptr<PPB_ImageData_Impl> src_image,
|
| + const SkIRect& src_rect,
|
| + scoped_refptr<PPB_ImageData_Impl> dest_image,
|
| + const SkRect& dest_rect) {
|
| ImageDataAutoMapper auto_mapper(src_image);
|
|
|
| DCHECK(src_image->format() != dest_image->format());
|
| @@ -557,10 +559,9 @@ void PPB_Graphics2D_Impl::ViewFlushedPaint() {
|
| painted_flush_callback_.Execute(PP_OK);
|
| }
|
|
|
| -void PPB_Graphics2D_Impl::ExecutePaintImageData(PPB_ImageData_Impl* image,
|
| - int x, int y,
|
| - const gfx::Rect& src_rect,
|
| - gfx::Rect* invalidated_rect) {
|
| +void PPB_Graphics2D_Impl::ExecutePaintImageData(
|
| + scoped_refptr<PPB_ImageData_Impl> image, int x, int y,
|
| + const gfx::Rect& src_rect, gfx::Rect* invalidated_rect) {
|
| // Ensure the source image is mapped to read from it.
|
| ImageDataAutoMapper auto_mapper(image);
|
| if (!auto_mapper.is_valid())
|
| @@ -580,7 +581,7 @@ void PPB_Graphics2D_Impl::ExecutePaintImageData(PPB_ImageData_Impl* image,
|
|
|
| if (image->format() != image_data_->format()) {
|
| // Convert the image data if the format does not match.
|
| - ConvertImageData(image, src_irect, image_data_, dest_rect);
|
| + ConvertImageData(image, src_irect, image_data_.get(), dest_rect);
|
| } else {
|
| // We're guaranteed to have a mapped canvas since we mapped it in Init().
|
| skia::PlatformCanvas* backing_canvas = image_data_->GetPlatformCanvas();
|
| @@ -601,8 +602,8 @@ void PPB_Graphics2D_Impl::ExecuteScroll(const gfx::Rect& clip,
|
| *invalidated_rect = clip;
|
| }
|
|
|
| -void PPB_Graphics2D_Impl::ExecuteReplaceContents(PPB_ImageData_Impl* image,
|
| - gfx::Rect* invalidated_rect) {
|
| +void PPB_Graphics2D_Impl::ExecuteReplaceContents(
|
| + scoped_refptr<PPB_ImageData_Impl> image, gfx::Rect* invalidated_rect) {
|
| if (image->format() != image_data_->format()) {
|
| DCHECK(image->width() == image_data_->width() &&
|
| image->height() == image_data_->height());
|
| @@ -612,7 +613,7 @@ void PPB_Graphics2D_Impl::ExecuteReplaceContents(PPB_ImageData_Impl* image,
|
| SkIntToScalar(0),
|
| SkIntToScalar(image_data_->width()),
|
| SkIntToScalar(image_data_->height()) };
|
| - ConvertImageData(image, src_irect, image_data_, dest_rect);
|
| + ConvertImageData(image, src_irect, image_data_.get(), dest_rect);
|
| } else {
|
| // The passed-in image may not be mapped in our process, and we need to
|
| // guarantee that the current backing store is always mapped.
|
|
|