summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_widget.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-02 18:31:03 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-02 18:31:03 +0000
commit96c3499a9e4257bbd6a167da8dab42f65ef71fcf (patch)
treeb9adef8eaa7b1f32b99f82198b448668ee6c4dcd /chrome/renderer/render_widget.cc
parent060254cd407f502d2e04000c9a59269c14593627 (diff)
downloadchromium_src-96c3499a9e4257bbd6a167da8dab42f65ef71fcf.zip
chromium_src-96c3499a9e4257bbd6a167da8dab42f65ef71fcf.tar.gz
chromium_src-96c3499a9e4257bbd6a167da8dab42f65ef71fcf.tar.bz2
Fix more paint bugs in the transparent renderview code.
This was causing the green glitchiness on mouseover. Review URL: http://codereview.chromium.org/100298 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15143 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.cc')
-rw-r--r--chrome/renderer/render_widget.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/chrome/renderer/render_widget.cc b/chrome/renderer/render_widget.cc
index 105ce11..5bed201 100644
--- a/chrome/renderer/render_widget.cc
+++ b/chrome/renderer/render_widget.cc
@@ -310,13 +310,12 @@ void RenderWidget::ClearFocus() {
void RenderWidget::PaintRect(const gfx::Rect& rect,
skia::PlatformCanvas* canvas) {
+ // Bring the canvas into the coordinate system of the paint rect.
+ canvas->translate(static_cast<SkScalar>(-rect.x()),
+ static_cast<SkScalar>(-rect.y()));
+
// If there is a custom background, tile it.
if (!background_.empty()) {
- canvas->save();
-
- SkIRect clipRect = { rect.x(), rect.y(), rect.right(), rect.bottom() };
- canvas->setClipRegion(SkRegion(clipRect));
-
SkPaint paint;
SkShader* shader = SkShader::CreateBitmapShader(background_,
SkShader::kRepeat_TileMode,
@@ -324,14 +323,8 @@ void RenderWidget::PaintRect(const gfx::Rect& rect,
paint.setShader(shader)->unref();
paint.setPorterDuffXfermode(SkPorterDuff::kSrcOver_Mode);
canvas->drawPaint(paint);
-
- canvas->restore();
}
- // Bring the canvas into the coordinate system of the paint rect
- canvas->translate(static_cast<SkScalar>(-rect.x()),
- static_cast<SkScalar>(-rect.y()));
-
webwidget_->Paint(canvas, rect);
// Flush to underlying bitmap. TODO(darin): is this needed?