diff options
Diffstat (limited to 'Source/WebKit/android/jni')
-rw-r--r-- | Source/WebKit/android/jni/WebFrameView.cpp | 44 |
1 files changed, 7 insertions, 37 deletions
diff --git a/Source/WebKit/android/jni/WebFrameView.cpp b/Source/WebKit/android/jni/WebFrameView.cpp index a9b90cb..f30e5b7 100644 --- a/Source/WebKit/android/jni/WebFrameView.cpp +++ b/Source/WebKit/android/jni/WebFrameView.cpp @@ -54,45 +54,15 @@ WebFrameView::~WebFrameView() { Release(mWebViewCore); } -void WebFrameView::draw(WebCore::GraphicsContext* ctx, const WebCore::IntRect& rect) { +void WebFrameView::draw(WebCore::GraphicsContext* gc, const WebCore::IntRect& rect) { WebCore::Frame* frame = mFrameView->frame(); - if (NULL == frame->contentRenderer()) { - // We only do this if there is nothing else to draw. - // If there is a renderer, it will fill the bg itself, so we don't want to - // double-draw (slow) - SkCanvas* canvas = ctx->platformContext()->mCanvas; - canvas->drawColor(SK_ColorWHITE); - } else if (frame->tree()->parent()) { - // Note: this code was moved from FrameLoaderClientAndroid - // - // For subframe, create a new translated rect from the given rectangle. - WebCore::IntRect transRect(rect); - // In Frame::markAllMatchesForText(), it does a fake paint. So we need - // to handle the case where platformContext() is null. However, we still - // want to call paint, since WebKit must have called the paint for a reason. - SkCanvas* canvas = ctx->platformContext() ? ctx->platformContext()->mCanvas : NULL; - if (canvas) { - const WebCore::IntRect& bounds = getBounds(); - - // Grab the intersection of transRect and the frame's bounds. - transRect.intersect(bounds); - if (transRect.isEmpty()) - return; - - // Move the transRect into the frame's local coordinates. - transRect.move(-bounds.x(), -bounds.y()); - - // Translate the canvas, add a clip. - canvas->save(); - canvas->translate(SkIntToScalar(bounds.x()), SkIntToScalar(bounds.y())); - canvas->clipRect(transRect); - } - mFrameView->paintContents(ctx, transRect); - if (canvas) - canvas->restore(); - } else { - mFrameView->paintContents(ctx, rect); + if (frame->contentRenderer()) + mFrameView->paintContents(gc, rect); + else { + // FIXME: I'm not entirely sure this ever happens or is needed + gc->setFillColor(Color::white, ColorSpaceDeviceRGB); + gc->fillRect(rect); } } |