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

Unified Diff: Source/platform/graphics/ImageBufferSurface.cpp

Issue 1170523002: Removing GraphicsContext from ImageBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix for shape bug Created 5 years, 6 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
Index: Source/platform/graphics/ImageBufferSurface.cpp
diff --git a/Source/platform/graphics/ImageBufferSurface.cpp b/Source/platform/graphics/ImageBufferSurface.cpp
index 7f3f677ad182d3c8e532cbf6d2b088fbba49b76c..1a911382e5ce07743e264ccb32d900cbadb161df 100644
--- a/Source/platform/graphics/ImageBufferSurface.cpp
+++ b/Source/platform/graphics/ImageBufferSurface.cpp
@@ -87,26 +87,17 @@ PassRefPtr<SkImage> ImageBufferSurface::newImageSnapshot() const
return nullptr;
}
-static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap)
-{
- SkBitmap tmp;
- if (!bitmap.deepCopyTo(&tmp))
- bitmap.copyTo(&tmp, bitmap.colorType());
-
- return tmp;
-}
-
-void ImageBufferSurface::draw(GraphicsContext* context, const FloatRect& destRect, const FloatRect& srcRect, SkXfermode::Mode op, bool needsCopy)
+void ImageBufferSurface::draw(GraphicsContext* context, const FloatRect& destRect, const FloatRect& srcRect, SkXfermode::Mode op)
{
SkBitmap bmp = bitmap();
// For ImageBufferSurface that enables cachedBitmap, Use the cached bitmap for CPU side usage
// if it is available, otherwise generate and use it.
- if (!context->isAccelerated() && isAccelerated() && cachedBitmapEnabled() && isValid()) {
+ if (isAccelerated() && cachedBitmapEnabled() && isValid()) {
updateCachedBitmapIfNeeded();
bmp = cachedBitmap();
}
- RefPtr<Image> image = BitmapImage::create(needsCopy ? deepSkBitmapCopy(bmp) : bmp);
+ RefPtr<Image> image = BitmapImage::create(bmp);
context->drawImage(image.get(), destRect, srcRect, op, DoNotRespectImageOrientation);
}
« no previous file with comments | « Source/platform/graphics/ImageBufferSurface.h ('k') | Source/platform/graphics/RecordingImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698