diff options
Diffstat (limited to 'Source/WebCore')
7 files changed, 37 insertions, 10 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp index a410ba9..10bf363 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp @@ -776,13 +776,15 @@ void PlatformGraphicsContextRecording::drawBitmapPattern( } void PlatformGraphicsContextRecording::drawBitmapRect(const SkBitmap& bitmap, - const SkIRect* src, const SkRect& dst, + const SkIRect* srcPtr, const SkRect& dst, CompositeOperator op) { float widthScale = dst.width() == 0 ? 1 : bitmap.width() / dst.width(); float heightScale = dst.height() == 0 ? 1 : bitmap.height() / dst.height(); m_maxZoomScale = std::max(m_maxZoomScale, std::max(widthScale, heightScale)); - appendDrawingOperation(NEW_OP(DrawBitmapRect)(bitmap, *src, dst, op), dst); + // null src implies full bitmap as source rect + SkIRect src = srcPtr ? *srcPtr : SkIRect::MakeWH(bitmap.width(), bitmap.height()); + appendDrawingOperation(NEW_OP(DrawBitmapRect)(bitmap, src, dst, op), dst); } void PlatformGraphicsContextRecording::drawConvexPolygon(size_t numPoints, diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h index a8e69f5..eefd270 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h @@ -112,7 +112,7 @@ public: virtual void clearRect(const FloatRect& rect); virtual void drawBitmapPattern(const SkBitmap& bitmap, const SkMatrix& matrix, CompositeOperator compositeOp, const FloatRect& destRect); - virtual void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* src, + virtual void drawBitmapRect(const SkBitmap& bitmap, const SkIRect* srcPtr, const SkRect& dst, CompositeOperator op = CompositeSourceOver); virtual void drawConvexPolygon(size_t numPoints, const FloatPoint* points, bool shouldAntialias); diff --git a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp index 03d2fb2..ebdf6c9 100644 --- a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp @@ -228,11 +228,20 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, // set filtering, to make scaled images look nice(r) paint.setFilterBitmap(true); + SkMatrix rotator; + rotator.reset(); + if (font->platformData().orientation() == Vertical) { + canvas->save(); + canvas->rotate(-90); + rotator.setRotate(90); + } + int localIndex = 0; int localCount = 0; for (int i = 0; i < numGlyphs; i++) { if (EmojiFont::IsEmojiGlyph(glyphs[i])) { if (localCount) { + rotator.mapPoints(&pos[localIndex], localCount); canvas->drawPosText(&glyphs[localIndex], localCount * sizeof(uint16_t), &pos[localIndex], paint); @@ -248,12 +257,18 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font, x += SkFloatToScalar(adv[i].width()); y += SkFloatToScalar(adv[i].height()); } + // draw the last run of glyphs (if any) if (localCount) { + rotator.mapPoints(&pos[localIndex], localCount); canvas->drawPosText(&glyphs[localIndex], localCount * sizeof(uint16_t), &pos[localIndex], paint); + } + + if (font->platformData().orientation() == Vertical) + canvas->restore(); } else { for (int i = 0; i < numGlyphs; i++) { pos[i].set(x, y); diff --git a/Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h b/Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h index dca769f..704f89a 100644 --- a/Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h +++ b/Source/WebCore/platform/graphics/android/layers/AndroidAnimation.h @@ -50,8 +50,14 @@ public: bool evaluate(LayerAndroid* layer, double time); virtual void applyForProgress(LayerAndroid* layer, float progress) = 0; static long instancesCount(); - void setName(const String& name) { m_name = name; } - String name() { return m_name; } + + // Since this class is shared between WebKit/UI thread, deep copy the name in the setter and + // don't share the value of m_name - this way this AndroidAnimation can be safely destroyed on + //any thread, since it is deref'd on both + void setName(const String& name) { m_name = name.threadsafeCopy(); } + bool isNamed(const String& name) { return m_name == name; } + String nameCopy() { return m_name.threadsafeCopy(); } + AnimatedPropertyID type() { return m_type; } bool fillsBackwards() { return m_fillsBackwards; } bool fillsForwards() { return m_fillsForwards; } @@ -65,7 +71,7 @@ protected: int m_iterationCount; int m_direction; RefPtr<TimingFunction> m_timingFunction; - String m_name; + String m_name; // Unique to this object, see comments for 'name' functions above AnimatedPropertyID m_type; KeyframeValueList* m_operations; int m_uniqueId; diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp index 4dbb9ba..1064388 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp @@ -299,7 +299,7 @@ void LayerAndroid::addDirtyArea() void LayerAndroid::addAnimation(PassRefPtr<AndroidAnimation> prpAnim) { RefPtr<AndroidAnimation> anim = prpAnim; - pair<String, int> key(anim->name(), anim->type()); + pair<String, int> key(anim->nameCopy(), anim->type()); removeAnimationsForProperty(anim->type()); m_animations.add(key, anim); } @@ -322,7 +322,7 @@ void LayerAndroid::removeAnimationsForKeyframes(const String& name) KeyframesMap::const_iterator end = m_animations.end(); Vector<pair<String, int> > toDelete; for (KeyframesMap::const_iterator it = m_animations.begin(); it != end; ++it) { - if ((it->second)->name() == name) + if ((it->second)->isNamed(name)) toDelete.append(it->first); } diff --git a/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp b/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp index aa18898..50f862d 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp @@ -452,7 +452,7 @@ TransferQueue* TilesManager::transferQueue() // be accessed from the TexturesGenerator. However, that can only happen after // a previous transferQueue() call due to a prepare. if (!m_queue) - m_queue = new TransferQueue(m_useMinimalMemory); + m_queue = new TransferQueue(m_useMinimalMemory && !m_highEndGfx); return m_queue; } diff --git a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp index b15fa6d..7c03219 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TransferQueue.cpp @@ -117,9 +117,13 @@ void TransferQueue::initGLResources(int width, int height) m_sharedSurfaceTexture->setSynchronousMode(true); int extraBuffersNeeded = 0; + int extraHackyBuffersNeeded = 0; + if (m_transferQueueSize == EFFICIENT_SIZE) + extraHackyBuffersNeeded = 13; m_ANW->query(m_ANW.get(), NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &extraBuffersNeeded); - bufferQueue->setBufferCount(m_transferQueueSize + extraBuffersNeeded); + bufferQueue->setBufferCount(m_transferQueueSize + extraBuffersNeeded + + extraHackyBuffersNeeded); int result = native_window_set_buffers_geometry(m_ANW.get(), width, height, HAL_PIXEL_FORMAT_RGBA_8888); |