| Index: content/renderer/pepper/pepper_graphics_2d_host.cc
|
| diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc
|
| index c6cb5808fbf685af05284bd09d500c7307300c0a..05ac4406217be38422a2bc1857757294e3af3044 100644
|
| --- a/content/renderer/pepper/pepper_graphics_2d_host.cc
|
| +++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
|
| @@ -276,13 +276,14 @@ bool PepperGraphics2DHost::ReadImageData(PP_Resource image,
|
| // Convert the image data if the format does not match.
|
| ConvertImageData(image_data_.get(), src_irect, image_resource, dest_rect);
|
| } else {
|
| - SkCanvas* dest_canvas = image_resource->GetCanvas();
|
| + CdlCanvas* dest_canvas = image_resource->GetCanvas();
|
|
|
| // We want to replace the contents of the bitmap rather than blend.
|
| SkPaint paint;
|
| paint.setBlendMode(SkBlendMode::kSrc);
|
| - dest_canvas->drawBitmapRect(
|
| - image_data_->GetMappedBitmap(), src_irect, dest_rect, &paint);
|
| + GetSkCanvas(dest_canvas)
|
| + ->drawBitmapRect(image_data_->GetMappedBitmap(), src_irect, dest_rect,
|
| + &paint);
|
| }
|
| return true;
|
| }
|
| @@ -327,7 +328,7 @@ void PepperGraphics2DHost::Paint(blink::WebCanvas* canvas,
|
| gfx::Rect invalidate_rect = plugin_rect;
|
| invalidate_rect.Intersect(paint_rect);
|
| SkRect sk_invalidate_rect = gfx::RectToSkRect(invalidate_rect);
|
| - SkAutoCanvasRestore auto_restore(canvas, true);
|
| + CdlAutoCanvasRestore auto_restore(canvas, true);
|
| canvas->clipRect(sk_invalidate_rect);
|
| gfx::Size pixel_image_size(image_data_->width(), image_data_->height());
|
| gfx::Size image_size = gfx::ScaleToFlooredSize(pixel_image_size, scale_);
|
| @@ -343,18 +344,18 @@ void PepperGraphics2DHost::Paint(blink::WebCanvas* canvas,
|
| // show white (typically less jarring) rather than black or uninitialized.
|
| // We don't do this for non-full-frame plugins since we specifically want
|
| // the page background to show through.
|
| - SkAutoCanvasRestore auto_restore(canvas, true);
|
| + CdlAutoCanvasRestore auto_restore(canvas, true);
|
| SkRect image_data_rect =
|
| gfx::RectToSkRect(gfx::Rect(plugin_rect.origin(), image_size));
|
| canvas->clipRect(image_data_rect, SkRegion::kDifference_Op);
|
|
|
| - SkPaint paint;
|
| + CdlPaint paint;
|
| paint.setBlendMode(SkBlendMode::kSrc);
|
| paint.setColor(SK_ColorWHITE);
|
| canvas->drawRect(sk_invalidate_rect, paint);
|
| }
|
|
|
| - SkPaint paint;
|
| + CdlPaint paint;
|
| if (is_always_opaque_) {
|
| // When we know the device is opaque, we can disable blending for slightly
|
| // more optimized painting.
|
| @@ -735,13 +736,14 @@ void PepperGraphics2DHost::ExecutePaintImageData(PPB_ImageData_Impl* image,
|
| ConvertImageData(image, src_irect, image_data_.get(), dest_rect);
|
| } else {
|
| // We're guaranteed to have a mapped canvas since we mapped it in Init().
|
| - SkCanvas* backing_canvas = image_data_->GetCanvas();
|
| + CdlCanvas* backing_canvas = image_data_->GetCanvas();
|
|
|
| // We want to replace the contents of the bitmap rather than blend.
|
| SkPaint paint;
|
| paint.setBlendMode(SkBlendMode::kSrc);
|
| - backing_canvas->drawBitmapRect(
|
| - image->GetMappedBitmap(), src_irect, dest_rect, &paint);
|
| + GetSkCanvas(backing_canvas)
|
| + ->drawBitmapRect(image->GetMappedBitmap(), src_irect, dest_rect,
|
| + &paint);
|
| }
|
| }
|
|
|
|
|