summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 17:02:25 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-18 17:02:25 +0000
commitf05c3e12f1fafedb16a5dcfc0b4ec1a4c2c019a1 (patch)
tree0e9f7ebd92381f9c67baa740c7ba472c8a5f64a1 /views/widget
parent0dedf72573b37d924b4a29b76cb17550d2cf5f81 (diff)
downloadchromium_src-f05c3e12f1fafedb16a5dcfc0b4ec1a4c2c019a1.zip
chromium_src-f05c3e12f1fafedb16a5dcfc0b4ec1a4c2c019a1.tar.gz
chromium_src-f05c3e12f1fafedb16a5dcfc0b4ec1a4c2c019a1.tar.bz2
Fix some rendering glitches in the custom frame by re-introducing nasty old code since I have found no way to avoid using it.
BUG=79640 TEST=see bug Review URL: http://codereview.chromium.org/7038021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85774 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/widget_win.cc14
-rw-r--r--views/widget/widget_win.h14
2 files changed, 17 insertions, 11 deletions
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index 353fe4b..3d3a2b7 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -434,7 +434,7 @@ void WidgetWin::SchedulePaintInRect(const gfx::Rect& rect) {
if (use_layered_buffer_) {
// We must update the back-buffer immediately, since Windows' handling of
// invalid rects is somewhat mysterious.
- layered_window_invalid_rect_ = layered_window_invalid_rect_.Union(rect);
+ invalid_rect_ = invalid_rect_.Union(rect);
// In some situations, such as drag and drop, when Windows itself runs a
// nested message loop our message loop appears to be starved and we don't
@@ -1080,15 +1080,15 @@ void WidgetWin::RedrawInvalidRect() {
}
void WidgetWin::RedrawLayeredWindowContents() {
- if (layered_window_invalid_rect_.IsEmpty())
+ if (invalid_rect_.IsEmpty())
return;
// We need to clip to the dirty rect ourselves.
layered_window_contents_->save(SkCanvas::kClip_SaveFlag);
- layered_window_contents_->ClipRectInt(layered_window_invalid_rect_.x(),
- layered_window_invalid_rect_.y(),
- layered_window_invalid_rect_.width(),
- layered_window_invalid_rect_.height());
+ layered_window_contents_->ClipRectInt(invalid_rect_.x(),
+ invalid_rect_.y(),
+ invalid_rect_.width(),
+ invalid_rect_.height());
GetWidget()->GetRootView()->Paint(layered_window_contents_.get());
layered_window_contents_->restore();
@@ -1101,7 +1101,7 @@ void WidgetWin::RedrawLayeredWindowContents() {
BLENDFUNCTION blend = {AC_SRC_OVER, 0, layered_alpha_, AC_SRC_ALPHA};
UpdateLayeredWindow(hwnd(), NULL, &position, &size, dib_dc, &zero,
RGB(0xFF, 0xFF, 0xFF), &blend, ULW_ALPHA);
- layered_window_invalid_rect_.SetRect(0, 0, 0, 0);
+ invalid_rect_.SetRect(0, 0, 0, 0);
layered_window_contents_->endPlatformPaint();
}
diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h
index c659b61..79f3f49 100644
--- a/views/widget/widget_win.h
+++ b/views/widget/widget_win.h
@@ -397,6 +397,8 @@ class WidgetWin : public ui::WindowImpl,
// Are a subclass of WindowWin?
bool is_window_;
+ const gfx::Rect& invalid_rect() const { return invalid_rect_; }
+
private:
typedef ScopedVector<ui::ViewProp> ViewProps;
@@ -460,10 +462,14 @@ class WidgetWin : public ui::WindowImpl,
// window.
scoped_ptr<gfx::CanvasSkia> layered_window_contents_;
- // We must track the invalid rect for a layered window ourselves, since
- // Windows will not do this properly with InvalidateRect()/GetUpdateRect().
- // (In fact, it'll return misleading information from GetUpdateRect()).
- gfx::Rect layered_window_invalid_rect_;
+ // We must track the invalid rect ourselves, for two reasons:
+ // For layered windows, Windows will not do this properly with
+ // InvalidateRect()/GetUpdateRect(). (In fact, it'll return misleading
+ // information from GetUpdateRect()).
+ // We also need to keep track of the invalid rectangle for the RootView should
+ // we need to paint the non-client area. The data supplied to WM_NCPAINT seems
+ // to be insufficient.
+ gfx::Rect invalid_rect_;
// A factory that allows us to schedule a redraw for layered windows.
ScopedRunnableMethodFactory<WidgetWin> paint_layered_window_factory_;