diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-05 20:39:40 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-05 20:39:40 +0000 |
commit | 736441a7a4e0dde8240d5eeca984351fb0100501 (patch) | |
tree | 9782153c9640e4232df4679bb45bfbe2fb4bc50c /webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | |
parent | e57621dc225923cf9d4bf68feb2495dd750ea652 (diff) | |
download | chromium_src-736441a7a4e0dde8240d5eeca984351fb0100501.zip chromium_src-736441a7a4e0dde8240d5eeca984351fb0100501.tar.gz chromium_src-736441a7a4e0dde8240d5eeca984351fb0100501.tar.bz2 |
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
Diffstat (limited to 'webkit/plugins/ppapi/ppb_graphics_2d_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 51 |
1 files changed, 0 insertions, 51 deletions
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<CGDataProviderRef> data_provider( - CGDataProviderCreateWithData( - NULL, backing_bitmap.getAddr32(0, 0), - backing_bitmap.rowBytes() * backing_bitmap.height(), NULL)); - base::mac::ScopedCFTypeRef<CGImageRef> 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<float>(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() { |