From 736441a7a4e0dde8240d5eeca984351fb0100501 Mon Sep 17 00:00:00 2001 From: "teravest@chromium.org" Date: Tue, 5 Mar 2013 20:39:40 +0000 Subject: Pepper cleanup: USE_SKIA is always true. We always build with skia now. This change removes dead code, and unnecessary USE_SKIA guards. BUG=110881 Review URL: https://chromiumcodereview.appspot.com/12437007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186249 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 51 ---------------------------- 1 file changed, 51 deletions(-) (limited to '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 3de90b6..590a61d 100644 --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc @@ -508,56 +508,6 @@ void PPB_Graphics2D_Impl::Paint(WebKit::WebCanvas* canvas, ImageDataAutoMapper auto_mapper(image_data_); const SkBitmap& backing_bitmap = *image_data_->GetMappedBitmap(); -#if defined(OS_MACOSX) && !defined(USE_SKIA) - SkAutoLockPixels lock(backing_bitmap); - - base::mac::ScopedCFTypeRef data_provider( - CGDataProviderCreateWithData( - NULL, backing_bitmap.getAddr32(0, 0), - backing_bitmap.rowBytes() * backing_bitmap.height(), NULL)); - base::mac::ScopedCFTypeRef image( - CGImageCreate( - backing_bitmap.width(), backing_bitmap.height(), - 8, 32, backing_bitmap.rowBytes(), - base::mac::GetSystemColorSpace(), - kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host, - data_provider, NULL, false, kCGRenderingIntentDefault)); - - // Flip the transform - gfx::ScopedCGContextSaveGState save_gstate(canvas) - float window_height = static_cast(CGBitmapContextGetHeight(canvas)); - CGContextTranslateCTM(canvas, 0, window_height); - CGContextScaleCTM(canvas, 1.0, -1.0); - - // To avoid painting outside the plugin boundaries and clip instead of - // scaling, CGContextDrawImage() must draw the full image using |bitmap_rect| - // but the context must be clipped to the plugin using |bounds|. - - CGRect bitmap_rect; - bitmap_rect.origin.x = plugin_rect.origin().x(); - bitmap_rect.origin.y = window_height - plugin_rect.origin().y() - - backing_bitmap.height(); - bitmap_rect.size.width = backing_bitmap.width(); - bitmap_rect.size.height = backing_bitmap.height(); - - CGRect bounds; - bounds.origin.x = plugin_rect.origin().x(); - bounds.origin.y = window_height - plugin_rect.origin().y() - - plugin_rect.height(); - bounds.size.width = plugin_rect.width(); - bounds.size.height = plugin_rect.height(); - // TODO(yzshen): We should take |paint_rect| into consideration as well. - CGContextClipToRect(canvas, bounds); - - // TODO(jhorwich) Figure out if this code is even active anymore, and if so - // how to properly handle scaling. - DCHECK_EQ(1.0f, scale_); - - // TODO(brettw) bug 56673: do a direct memcpy instead of going through CG - // if the is_always_opaque_ flag is set. Must ensure bitmap is still clipped. - - CGContextDrawImage(canvas, bitmap_rect, image); -#else gfx::Rect invalidate_rect = gfx::IntersectRects(plugin_rect, paint_rect); SkRect sk_invalidate_rect = gfx::RectToSkRect(invalidate_rect); SkAutoCanvasRestore auto_restore(canvas, true); @@ -612,7 +562,6 @@ void PPB_Graphics2D_Impl::Paint(WebKit::WebCanvas* canvas, canvas->scale(scale_, scale_); } canvas->drawBitmap(image, pixel_origin.x(), pixel_origin.y(), &paint); -#endif } void PPB_Graphics2D_Impl::ViewWillInitiatePaint() { -- cgit v1.1