diff options
| author | Chris Craik <ccraik@google.com> | 2012-04-10 13:58:24 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-04-10 13:58:24 -0700 |
| commit | 22ad8c581dc11ba2311ca76a17ec046f72f53fcf (patch) | |
| tree | 5444b165a2ae1b8c4bad9c365890a78b4fef37ed /Source | |
| parent | 76341882c2996a94161cf723482a17a49eb6e4a4 (diff) | |
| parent | 75fc360d144b97f5e50bedf7ed3222898cc56446 (diff) | |
| download | external_webkit-22ad8c581dc11ba2311ca76a17ec046f72f53fcf.zip external_webkit-22ad8c581dc11ba2311ca76a17ec046f72f53fcf.tar.gz external_webkit-22ad8c581dc11ba2311ca76a17ec046f72f53fcf.tar.bz2 | |
Merge "Expand base layer bounds to fill viewport"
Diffstat (limited to 'Source')
3 files changed, 17 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp index 1de5ae7..ce520b4 100644 --- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp @@ -53,4 +53,17 @@ void BaseLayerAndroid::getLocalTransform(SkMatrix* matrix) const matrix->preConcat(getMatrix()); } +IFrameLayerAndroid* BaseLayerAndroid::updatePosition(SkRect viewport, + IFrameLayerAndroid* parentIframeLayer) +{ + if (viewport.fRight > getWidth() || viewport.fBottom > getHeight()) { + // To handle the viewport expanding past the layer's size with HW accel, + // expand the size of the layer, so that tiles will cover the viewport. + setSize(std::max(viewport.fRight, getWidth()), + std::max(viewport.fBottom, getHeight())); + } + + return LayerAndroid::updatePosition(viewport, parentIframeLayer); +} + } // namespace WebCore diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h index 0ef39c8..f4cf9f3 100644 --- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h @@ -49,6 +49,8 @@ public: virtual void getLocalTransform(SkMatrix* matrix) const; virtual const TransformationMatrix* drawTransform() const { return 0; } + virtual IFrameLayerAndroid* updatePosition(SkRect viewport, + IFrameLayerAndroid* parentIframeLayer); private: // TODO: move to SurfaceCollection. Color m_color; diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index a4381e6..05666bb 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -306,7 +306,8 @@ PictureSet* draw(SkCanvas* canvas, SkColor bgColor, DrawExtras extras, bool spli int sc = canvas->save(SkCanvas::kClip_SaveFlag); canvas->clipRect(SkRect::MakeLTRB(0, 0, content->width(), content->height()), SkRegion::kDifference_Op); - canvas->drawColor(bgColor); + Color c = m_baseLayer->getBackgroundColor(); + canvas->drawColor(SkColorSetARGBInline(c.alpha(), c.red(), c.green(), c.blue())); canvas->restoreToCount(sc); // call this to be sure we've adjusted for any scrolling or animations |
