diff options
author | Derek Sollenberger <djsollen@google.com> | 2013-02-22 09:43:21 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2013-02-22 09:43:21 -0500 |
commit | 9f80dad96d0f4636c459f5cfd95b044337eaf184 (patch) | |
tree | 2836a58ae3033cf9e81eecc12df5b7bc122e457d | |
parent | 8f409a964f8ece608f4eb34fe5c7d23ec16c8687 (diff) | |
parent | b6dd8e8e8d87d6f7816929bce8c04c0aac59c0ba (diff) | |
download | webkit-9f80dad96d0f4636c459f5cfd95b044337eaf184.tar.gz |
Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'
bug: 6906025
17 files changed, 46 insertions, 38 deletions
diff --git a/Android.mk b/Android.mk index 3d59ea713..f55d5a19c 100644 --- a/Android.mk +++ b/Android.mk @@ -87,6 +87,8 @@ LOCAL_C_INCLUDES := \ external/skia/include/images \ external/skia/include/ports \ external/skia/include/utils \ + external/skia/src/core \ + external/skia/src/images \ external/skia/src/ports \ external/sqlite/dist \ frameworks/base/core/jni/android/graphics \ @@ -322,7 +324,7 @@ LOCAL_CFLAGS += -DSUPPORT_COMPLEX_SCRIPTS=1 endif # Build the list of static libraries -LOCAL_STATIC_LIBRARIES := libxml2 libxslt libhyphenation libskiagpu libv8 +LOCAL_STATIC_LIBRARIES := libxml2 libxslt libhyphenation libv8 ifeq ($(ENABLE_AUTOFILL),true) LOCAL_SHARED_LIBRARIES += libexpat diff --git a/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp b/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp index 957040bbb..e69c1451a 100644 --- a/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp @@ -102,15 +102,13 @@ static void syncPlatformContext(GraphicsContext* gc) GraphicsContext* GraphicsContext::createOffscreenContext(int width, int height) { - PlatformGraphicsContextSkia* pgc = new PlatformGraphicsContextSkia(new SkCanvas, true); - SkBitmap bitmap; - bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); bitmap.allocPixels(); bitmap.eraseColor(0); - pgc->canvas()->setBitmapDevice(bitmap); + PlatformGraphicsContextSkia* pgc = + new PlatformGraphicsContextSkia(new SkCanvas(bitmap), true); GraphicsContext* ctx = new GraphicsContext(pgc); return ctx; } diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp index fcd9adee9..cd3ef7da1 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp @@ -9,6 +9,7 @@ #include "GraphicsContext.h" #include "SkCanvas.h" #include "SkCornerPathEffect.h" +#include "SkMathPriv.h" #include "SkPaint.h" #include "SkShader.h" #include "SkiaUtils.h" @@ -272,8 +273,7 @@ void PlatformGraphicsContextSkia::drawConvexPolygon(size_t numPoints, for (size_t i = 1; i < numPoints; i++) path.lineTo(SkFloatToScalar(points[i].x()), SkFloatToScalar(points[i].y())); - if (mCanvas->quickReject(path, shouldAntialias ? - SkCanvas::kAA_EdgeType : SkCanvas::kBW_EdgeType)) { + if (mCanvas->quickReject(path)) { return; } diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp index 10643881a..dcdd94bbe 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp @@ -47,9 +47,10 @@ static int gUniqueId; class OpacityDrawFilter : public SkDrawFilter { public: OpacityDrawFilter(int opacity) : m_opacity(opacity) { } - virtual void filter(SkPaint* paint, Type) + virtual bool filter(SkPaint* paint, Type) { paint->setAlpha(m_opacity); + return true; } private: int m_opacity; diff --git a/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp b/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp index f0e42926c..e7527bc59 100644 --- a/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp +++ b/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp @@ -61,13 +61,12 @@ float PictureLayerContent::maxZoomScale() // Let's check if we have text or not. If we don't, we can limit // ourselves to scale 1! - InspectorBounder inspectorBounder; - InspectorCanvas checker(&inspectorBounder, m_picture); SkBitmap bitmap; bitmap.setConfig(SkBitmap::kARGB_8888_Config, m_picture->width(), m_picture->height()); - checker.setBitmapDevice(bitmap); + InspectorBounder inspectorBounder; + InspectorCanvas checker(&inspectorBounder, m_picture, bitmap); checker.drawPicture(*m_picture); m_hasText = checker.hasText(); if (!checker.hasContent()) { @@ -148,11 +147,11 @@ void LegacyPictureLayerContent::draw(SkCanvas* canvas) { canvas->drawText(NULL, 0, 0, 0, paint); // decompose the canvas into basics - void* matrixStorage = malloc(canvas->getTotalMatrix().flatten(NULL)); - void* clipStorage = malloc(canvas->getTotalClip().flatten(NULL)); + void* matrixStorage = malloc(canvas->getTotalMatrix().writeToMemory(NULL)); + void* clipStorage = malloc(canvas->getTotalClip().writeToMemory(NULL)); - canvas->getTotalMatrix().flatten(matrixStorage); - canvas->getTotalClip().flatten(clipStorage); + canvas->getTotalMatrix().writeToMemory(matrixStorage); + canvas->getTotalClip().writeToMemory(clipStorage); const SkBitmap& bitmap = canvas->getDevice()->accessBitmap(true); bitmap.lockPixels(); diff --git a/Source/WebCore/platform/graphics/android/rendering/GaneshContext.cpp b/Source/WebCore/platform/graphics/android/rendering/GaneshContext.cpp index 5c4b45378..0ea8d93fd 100644 --- a/Source/WebCore/platform/graphics/android/rendering/GaneshContext.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/GaneshContext.cpp @@ -152,7 +152,7 @@ SkDevice* GaneshContext::getDeviceForTile(const TileRenderInfo& renderInfo) GrPlatformRenderTargetDesc renderTargetDesc; renderTargetDesc.fWidth = TilesManager::tileWidth(); renderTargetDesc.fHeight = TilesManager::tileHeight(); - renderTargetDesc.fConfig = kRGBA_8888_PM_GrPixelConfig; + renderTargetDesc.fConfig = kRGBA_8888_GrPixelConfig; renderTargetDesc.fSampleCnt = 0; renderTargetDesc.fStencilBits = 8; renderTargetDesc.fRenderTargetHandle = 0; diff --git a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp index db03753a7..64277ac5b 100644 --- a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp @@ -113,10 +113,7 @@ SkBitmap* ImageTexture::convertBitmap(SkBitmap* bitmap) // Create a copy of the image img->setConfig(SkBitmap::kARGB_8888_Config, w, h); img->allocPixels(); - SkDevice* device = new SkDevice(*img); - SkCanvas canvas; - canvas.setDevice(device); - device->unref(); + SkCanvas canvas(*img); SkRect dest; dest.set(0, 0, w, h); img->setIsOpaque(false); diff --git a/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.cpp b/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.cpp index f9edb7436..065cb94ff 100644 --- a/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.cpp @@ -66,6 +66,14 @@ void InspectorCanvas::commonDrawBitmap(const SkBitmap& bitmap, setHasContent(); } +void InspectorCanvas::drawBitmapRectToRect(const SkBitmap& bitmap, + const SkRect* src, + const SkRect& dst, + const SkPaint* paint) +{ + setHasContent(); +} + void InspectorCanvas::drawPaint(const SkPaint& paint) { setHasContent(); diff --git a/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.h b/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.h index 415a579ce..be28ad9e6 100644 --- a/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.h +++ b/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.h @@ -40,8 +40,9 @@ class InspectorBounder : public SkBounder { class InspectorCanvas : public SkCanvas { public: - InspectorCanvas(SkBounder* bounder, SkPicture* picture) - : m_picture(picture) + InspectorCanvas(SkBounder* bounder, SkPicture* picture, SkBitmap& bitmap) + : SkCanvas(bitmap) + , m_picture(picture) , m_hasText(false) , m_hasContent(false) { @@ -59,6 +60,10 @@ public: const SkIRect* rect, const SkMatrix&, const SkPaint&); + virtual void drawBitmapRectToRect(const SkBitmap& bitmap, + const SkRect* src, + const SkRect& dst, + const SkPaint* paint); virtual void drawPaint(const SkPaint& paint); virtual void drawPath(const SkPath&, const SkPaint& paint); diff --git a/Source/WebCore/platform/graphics/android/rendering/InstrumentedPlatformCanvas.h b/Source/WebCore/platform/graphics/android/rendering/InstrumentedPlatformCanvas.h index cc3ef550d..494bcb5e1 100644 --- a/Source/WebCore/platform/graphics/android/rendering/InstrumentedPlatformCanvas.h +++ b/Source/WebCore/platform/graphics/android/rendering/InstrumentedPlatformCanvas.h @@ -195,12 +195,12 @@ public: SkCanvas::drawBitmap(bitmap, left, top, paint); } - virtual void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* src, + virtual void drawBitmapRectToRect(const SkBitmap& bitmap, const SkRect* src, const SkRect& dst, const SkPaint* paint) { WRAPCANVAS_LOG_ENTRY(""); m_isSolidColor = false; - SkCanvas::drawBitmapRect(bitmap, src, dst, paint); + SkCanvas::drawBitmapRectToRect(bitmap, src, dst, paint); } virtual void drawBitmapMatrix(const SkBitmap& bitmap, diff --git a/Source/WebCore/plugins/android/PluginViewAndroid.cpp b/Source/WebCore/plugins/android/PluginViewAndroid.cpp index 24a14aa0d..fce5e288e 100644 --- a/Source/WebCore/plugins/android/PluginViewAndroid.cpp +++ b/Source/WebCore/plugins/android/PluginViewAndroid.cpp @@ -83,7 +83,6 @@ #include "ANPSystem_npapi.h" #include "ANPVideo_npapi.h" #include "SkANP.h" -#include "SkFlipPixelRef.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/Source/WebKit/android/jni/PicturePile.cpp b/Source/WebKit/android/jni/PicturePile.cpp index 44cfccbf9..f6fe5dbfa 100644 --- a/Source/WebKit/android/jni/PicturePile.cpp +++ b/Source/WebKit/android/jni/PicturePile.cpp @@ -84,8 +84,7 @@ void PicturePile::draw(SkCanvas* canvas) * the rect bounds of the SkRegion for the clip, so this still can't be * used for translucent surfaces */ - if (canvas->quickReject(SkRect::MakeWH(m_size.width(), m_size.height()), - SkCanvas::kBW_EdgeType)) + if (canvas->quickReject(SkRect::MakeWH(m_size.width(), m_size.height()))) return; drawWithClipRecursive(canvas, m_pile.size() - 1); } @@ -102,7 +101,7 @@ void PicturePile::drawWithClipRecursive(SkCanvas* canvas, int index) if (index < 0) return; PictureContainer& pc = m_pile[index]; - if (pc.picture && !canvas->quickReject(pc.area, SkCanvas::kBW_EdgeType)) { + if (pc.picture && !canvas->quickReject(pc.area)) { int saved = canvas->save(SkCanvas::kClip_SaveFlag); if (canvas->clipRect(pc.area, SkRegion::kDifference_Op)) drawWithClipRecursive(canvas, index - 1); diff --git a/Source/WebKit/android/jni/ViewStateSerializer.cpp b/Source/WebKit/android/jni/ViewStateSerializer.cpp index 650e202be..97c15d0e0 100644 --- a/Source/WebKit/android/jni/ViewStateSerializer.cpp +++ b/Source/WebKit/android/jni/ViewStateSerializer.cpp @@ -41,7 +41,8 @@ #include "PictureLayerContent.h" #include "ScrollableLayerAndroid.h" #include "SkData.h" -#include "SkFlattenable.h" +#include "SkOrderedReadBuffer.h" +#include "SkOrderedWriteBuffer.h" #include "SkPicture.h" #include "TilesManager.h" @@ -408,7 +409,7 @@ void serializeLayer(LayerAndroid* layer, SkWStream* stream) bool hasContentsImage = layer->m_imageCRC != 0; stream->writeBool(hasContentsImage); if (hasContentsImage) { - SkFlattenableWriteBuffer buffer(1024); + SkOrderedWriteBuffer buffer(1024); buffer.setFlags(SkFlattenableWriteBuffer::kCrossProcess_Flag); ImageTexture* imagetexture = ImagesManager::instance()->retainImage(layer->m_imageCRC); @@ -527,7 +528,7 @@ LayerAndroid* deserializeLayer(int version, SkMemoryStream* stream) int size = stream->readU32(); SkAutoMalloc storage(size); stream->read(storage.get(), size); - SkFlattenableReadBuffer buffer(storage.get(), size); + SkOrderedReadBuffer buffer(storage.get(), size); SkBitmap contentsImage; contentsImage.unflatten(buffer); SkBitmapRef* imageRef = new SkBitmapRef(contentsImage); diff --git a/Source/WebKit/android/jni/WebFrameView.cpp b/Source/WebKit/android/jni/WebFrameView.cpp index ed332aaf7..06faae558 100644 --- a/Source/WebKit/android/jni/WebFrameView.cpp +++ b/Source/WebKit/android/jni/WebFrameView.cpp @@ -50,7 +50,7 @@ WebFrameView::WebFrameView(WebCore::FrameView* frameView, WebViewCore* webViewCo } WebFrameView::~WebFrameView() { - Release(mWebViewCore); + ::Release(mWebViewCore); } void WebFrameView::draw(WebCore::GraphicsContext* gc, const WebCore::IntRect& rect) { diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index 8779038fb..497cc9a9c 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -560,7 +560,7 @@ WebViewCore::~WebViewCore() WebViewCore::removeInstance(this); // Release the focused view - Release(m_popupReply); + ::Release(m_popupReply); if (m_javaGlue->m_obj) { JNIEnv* env = JSC::Bindings::getJNIEnv(); @@ -3501,7 +3501,7 @@ void WebViewCore::popupReply(int index) { if (m_popupReply) { m_popupReply->replyInt(index); - Release(m_popupReply); + ::Release(m_popupReply); m_popupReply = 0; } } @@ -3510,7 +3510,7 @@ void WebViewCore::popupReply(const int* array, int count) { if (m_popupReply) { m_popupReply->replyIntArray(array, count); - Release(m_popupReply); + ::Release(m_popupReply); m_popupReply = 0; } } diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 66dbdc110..66eccb825 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -1180,7 +1180,7 @@ static void nativeOnTrimMemory(JNIEnv *env, jobject obj, jint level) static void nativeDumpDisplayTree(JNIEnv* env, jobject jwebview, jstring jurl) { -#ifdef ANDROID_DUMP_DISPLAY_TREE +#if defined(ANDROID_DUMP_DISPLAY_TREE) && defined(SK_DEVELOPER) WebView* view = GET_NATIVE_VIEW(env, jwebview); ALOG_ASSERT(view, "view not set in %s", __FUNCTION__); diff --git a/Source/WebKit/android/plugins/ANPCanvasInterface.cpp b/Source/WebKit/android/plugins/ANPCanvasInterface.cpp index d6d89ff30..451958733 100644 --- a/Source/WebKit/android/plugins/ANPCanvasInterface.cpp +++ b/Source/WebKit/android/plugins/ANPCanvasInterface.cpp @@ -80,8 +80,7 @@ static void anp_getTotalMatrix(ANPCanvas* canvas, ANPMatrix* matrix) { static bool anp_getLocalClipBounds(ANPCanvas* canvas, ANPRectF* r, bool antialias) { SkRect bounds; - if (canvas->skcanvas->getClipBounds(&bounds, - antialias ? SkCanvas::kAA_EdgeType : SkCanvas::kBW_EdgeType)) { + if (canvas->skcanvas->getClipBounds(&bounds)) { SkANP::SetRect(r, bounds); return true; } |