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

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

Issue 1001703003: Take NativeImageSkia out behind the woodshed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Switch to skia-style API (return bool instead of SkBitmap) Created 5 years, 9 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 | « Source/platform/graphics/GraphicsContextTest.cpp ('k') | Source/platform/graphics/Image.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsLayer.cpp
diff --git a/Source/platform/graphics/GraphicsLayer.cpp b/Source/platform/graphics/GraphicsLayer.cpp
index c0216a770ce1c43bf129097bfae884b230cb3039..f1c1f5abef33d2b5edc894a7891478a0afcb4f2d 100644
--- a/Source/platform/graphics/GraphicsLayer.cpp
+++ b/Source/platform/graphics/GraphicsLayer.cpp
@@ -39,7 +39,6 @@
#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
#include "platform/graphics/paint/DisplayItemList.h"
#include "platform/graphics/paint/DrawingRecorder.h"
-#include "platform/graphics/skia/NativeImageSkia.h"
#include "platform/scroll/ScrollableArea.h"
#include "platform/text/TextStream.h"
#include "public/platform/Platform.h"
@@ -1008,13 +1007,13 @@ void GraphicsLayer::setContentsRect(const IntRect& rect)
void GraphicsLayer::setContentsToImage(Image* image)
{
- RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFrame() : nullptr;
- if (nativeImage) {
+ SkBitmap bitmap;
+ if (image && image->bitmapForCurrentFrame(&bitmap)) {
if (!m_imageLayer) {
m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->createImageLayer());
registerContentsLayer(m_imageLayer->layer());
}
- m_imageLayer->setImageBitmap(nativeImage->bitmap());
+ m_imageLayer->setImageBitmap(bitmap);
m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque());
updateContentsRect();
} else {
@@ -1033,10 +1032,9 @@ void GraphicsLayer::setContentsToNinePatch(Image* image, const IntRect& aperture
unregisterContentsLayer(m_ninePatchLayer->layer());
m_ninePatchLayer.clear();
}
- RefPtr<NativeImageSkia> nativeImage = image ? image->nativeImageForCurrentFrame() : nullptr;
- if (nativeImage) {
+ SkBitmap bitmap;
+ if (image && image->bitmapForCurrentFrame(&bitmap)) {
m_ninePatchLayer = adoptPtr(Platform::current()->compositorSupport()->createNinePatchLayer());
- const SkBitmap& bitmap = nativeImage->bitmap();
int borderWidth = bitmap.width() - aperture.width();
int borderHeight = bitmap.height() - aperture.height();
WebRect border(aperture.x(), aperture.y(), borderWidth, borderHeight);
« no previous file with comments | « Source/platform/graphics/GraphicsContextTest.cpp ('k') | Source/platform/graphics/Image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698