From 455b107800e69ea7615ffad1a83bb250d699f6ae Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Wed, 13 Feb 2013 10:22:00 -0800 Subject: Revert "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'" DO NOT MERGE This reverts commit 77437f7411c2a1b6eed9e8635cd1d79c216064af, reversing changes made to 97df262f2fd351a399bc757d3f7e7c7bb3b00065. Change-Id: I594d7f423efce65f02b7ac14aff875aa22742ad0 --- Android.mk | 4 +--- .../graphics/android/context/GraphicsContextAndroid.cpp | 6 ++++-- .../android/context/PlatformGraphicsContextSkia.cpp | 4 ++-- .../platform/graphics/android/layers/LayerAndroid.cpp | 3 +-- .../graphics/android/layers/PictureLayerContent.cpp | 13 +++++++------ .../platform/graphics/android/rendering/GaneshContext.cpp | 2 +- .../platform/graphics/android/rendering/ImageTexture.cpp | 5 ++++- .../platform/graphics/android/rendering/InspectorCanvas.h | 5 ++--- Source/WebCore/plugins/android/PluginViewAndroid.cpp | 1 + Source/WebKit/android/jni/PicturePile.cpp | 5 +++-- Source/WebKit/android/jni/ViewStateSerializer.cpp | 7 +++---- Source/WebKit/android/jni/WebFrameView.cpp | 2 +- Source/WebKit/android/jni/WebViewCore.cpp | 6 +++--- Source/WebKit/android/nav/WebView.cpp | 2 +- Source/WebKit/android/plugins/ANPCanvasInterface.cpp | 3 ++- 15 files changed, 36 insertions(+), 32 deletions(-) diff --git a/Android.mk b/Android.mk index f55d5a19c..3d59ea713 100644 --- a/Android.mk +++ b/Android.mk @@ -87,8 +87,6 @@ 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 \ @@ -324,7 +322,7 @@ LOCAL_CFLAGS += -DSUPPORT_COMPLEX_SCRIPTS=1 endif # Build the list of static libraries -LOCAL_STATIC_LIBRARIES := libxml2 libxslt libhyphenation libv8 +LOCAL_STATIC_LIBRARIES := libxml2 libxslt libhyphenation libskiagpu 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 e69c1451a..957040bbb 100644 --- a/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/context/GraphicsContextAndroid.cpp @@ -102,13 +102,15 @@ 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 cd3ef7da1..fcd9adee9 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextSkia.cpp @@ -9,7 +9,6 @@ #include "GraphicsContext.h" #include "SkCanvas.h" #include "SkCornerPathEffect.h" -#include "SkMathPriv.h" #include "SkPaint.h" #include "SkShader.h" #include "SkiaUtils.h" @@ -273,7 +272,8 @@ 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)) { + if (mCanvas->quickReject(path, shouldAntialias ? + SkCanvas::kAA_EdgeType : SkCanvas::kBW_EdgeType)) { return; } diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp index dcdd94bbe..10643881a 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp @@ -47,10 +47,9 @@ static int gUniqueId; class OpacityDrawFilter : public SkDrawFilter { public: OpacityDrawFilter(int opacity) : m_opacity(opacity) { } - virtual bool filter(SkPaint* paint, Type) + virtual void 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 e7527bc59..f0e42926c 100644 --- a/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp +++ b/Source/WebCore/platform/graphics/android/layers/PictureLayerContent.cpp @@ -61,12 +61,13 @@ 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()); - InspectorBounder inspectorBounder; - InspectorCanvas checker(&inspectorBounder, m_picture, bitmap); + checker.setBitmapDevice(bitmap); checker.drawPicture(*m_picture); m_hasText = checker.hasText(); if (!checker.hasContent()) { @@ -147,11 +148,11 @@ void LegacyPictureLayerContent::draw(SkCanvas* canvas) { canvas->drawText(NULL, 0, 0, 0, paint); // decompose the canvas into basics - void* matrixStorage = malloc(canvas->getTotalMatrix().writeToMemory(NULL)); - void* clipStorage = malloc(canvas->getTotalClip().writeToMemory(NULL)); + void* matrixStorage = malloc(canvas->getTotalMatrix().flatten(NULL)); + void* clipStorage = malloc(canvas->getTotalClip().flatten(NULL)); - canvas->getTotalMatrix().writeToMemory(matrixStorage); - canvas->getTotalClip().writeToMemory(clipStorage); + canvas->getTotalMatrix().flatten(matrixStorage); + canvas->getTotalClip().flatten(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 0ea8d93fd..5c4b45378 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_GrPixelConfig; + renderTargetDesc.fConfig = kRGBA_8888_PM_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 64277ac5b..db03753a7 100644 --- a/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/ImageTexture.cpp @@ -113,7 +113,10 @@ SkBitmap* ImageTexture::convertBitmap(SkBitmap* bitmap) // Create a copy of the image img->setConfig(SkBitmap::kARGB_8888_Config, w, h); img->allocPixels(); - SkCanvas canvas(*img); + SkDevice* device = new SkDevice(*img); + SkCanvas canvas; + canvas.setDevice(device); + device->unref(); SkRect dest; dest.set(0, 0, w, h); img->setIsOpaque(false); diff --git a/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.h b/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.h index 47dc8f763..415a579ce 100644 --- a/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.h +++ b/Source/WebCore/platform/graphics/android/rendering/InspectorCanvas.h @@ -40,9 +40,8 @@ class InspectorBounder : public SkBounder { class InspectorCanvas : public SkCanvas { public: - InspectorCanvas(SkBounder* bounder, SkPicture* picture, SkBitmap& bitmap) - : SkCanvas(bitmap) - , m_picture(picture) + InspectorCanvas(SkBounder* bounder, SkPicture* picture) + : m_picture(picture) , m_hasText(false) , m_hasContent(false) { diff --git a/Source/WebCore/plugins/android/PluginViewAndroid.cpp b/Source/WebCore/plugins/android/PluginViewAndroid.cpp index fce5e288e..24a14aa0d 100644 --- a/Source/WebCore/plugins/android/PluginViewAndroid.cpp +++ b/Source/WebCore/plugins/android/PluginViewAndroid.cpp @@ -83,6 +83,7 @@ #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 f6fe5dbfa..44cfccbf9 100644 --- a/Source/WebKit/android/jni/PicturePile.cpp +++ b/Source/WebKit/android/jni/PicturePile.cpp @@ -84,7 +84,8 @@ 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()))) + if (canvas->quickReject(SkRect::MakeWH(m_size.width(), m_size.height()), + SkCanvas::kBW_EdgeType)) return; drawWithClipRecursive(canvas, m_pile.size() - 1); } @@ -101,7 +102,7 @@ void PicturePile::drawWithClipRecursive(SkCanvas* canvas, int index) if (index < 0) return; PictureContainer& pc = m_pile[index]; - if (pc.picture && !canvas->quickReject(pc.area)) { + if (pc.picture && !canvas->quickReject(pc.area, SkCanvas::kBW_EdgeType)) { 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 97c15d0e0..650e202be 100644 --- a/Source/WebKit/android/jni/ViewStateSerializer.cpp +++ b/Source/WebKit/android/jni/ViewStateSerializer.cpp @@ -41,8 +41,7 @@ #include "PictureLayerContent.h" #include "ScrollableLayerAndroid.h" #include "SkData.h" -#include "SkOrderedReadBuffer.h" -#include "SkOrderedWriteBuffer.h" +#include "SkFlattenable.h" #include "SkPicture.h" #include "TilesManager.h" @@ -409,7 +408,7 @@ void serializeLayer(LayerAndroid* layer, SkWStream* stream) bool hasContentsImage = layer->m_imageCRC != 0; stream->writeBool(hasContentsImage); if (hasContentsImage) { - SkOrderedWriteBuffer buffer(1024); + SkFlattenableWriteBuffer buffer(1024); buffer.setFlags(SkFlattenableWriteBuffer::kCrossProcess_Flag); ImageTexture* imagetexture = ImagesManager::instance()->retainImage(layer->m_imageCRC); @@ -528,7 +527,7 @@ LayerAndroid* deserializeLayer(int version, SkMemoryStream* stream) int size = stream->readU32(); SkAutoMalloc storage(size); stream->read(storage.get(), size); - SkOrderedReadBuffer buffer(storage.get(), size); + SkFlattenableReadBuffer 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 06faae558..ed332aaf7 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 497cc9a9c..8779038fb 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 66eccb825..66dbdc110 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) { -#if defined(ANDROID_DUMP_DISPLAY_TREE) && defined(SK_DEVELOPER) +#ifdef ANDROID_DUMP_DISPLAY_TREE 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 451958733..d6d89ff30 100644 --- a/Source/WebKit/android/plugins/ANPCanvasInterface.cpp +++ b/Source/WebKit/android/plugins/ANPCanvasInterface.cpp @@ -80,7 +80,8 @@ 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)) { + if (canvas->skcanvas->getClipBounds(&bounds, + antialias ? SkCanvas::kAA_EdgeType : SkCanvas::kBW_EdgeType)) { SkANP::SetRect(r, bounds); return true; } -- cgit v1.2.3