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

Unified Diff: content/renderer/pepper/pepper_graphics_2d_host.cc

Issue 12437007: Pepper cleanup: USE_SKIA is always true. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 73ee27f8f99de73d8fd829d99431b9e84106f502..fc5e139c44fe387d43ade991c65e13a9ddc59ce1 100644
--- a/content/renderer/pepper/pepper_graphics_2d_host.cc
+++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
@@ -325,56 +325,6 @@ void PepperGraphics2DHost::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 = plugin_rect;
invalidate_rect.Intersect(paint_rect);
SkRect sk_invalidate_rect = gfx::RectToSkRect(invalidate_rect);
@@ -431,7 +381,6 @@ void PepperGraphics2DHost::Paint(WebKit::WebCanvas* canvas,
canvas->scale(scale_, scale_);
}
canvas->drawBitmap(image, pixel_origin.x(), pixel_origin.y(), &paint);
-#endif
}
void PepperGraphics2DHost::ViewWillInitiatePaint() {
« no previous file with comments | « no previous file | webkit/plugins/ppapi/ppapi_plugin_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698