From f3735c5dc0269579afc173d9e519243c305e1186 Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Thu, 19 Mar 2009 17:26:23 +0000 Subject: Render into a ChromeCanvasPaint object in a RootView under Linux. Review URL: http://codereview.chromium.org/45014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12097 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/views/widget/root_view_gtk.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'chrome/views/widget/root_view_gtk.cc') diff --git a/chrome/views/widget/root_view_gtk.cc b/chrome/views/widget/root_view_gtk.cc index 89ed51a6..1c7fe9c 100644 --- a/chrome/views/widget/root_view_gtk.cc +++ b/chrome/views/widget/root_view_gtk.cc @@ -5,6 +5,8 @@ #include "chrome/views/widget/root_view.h" #include "base/logging.h" +#include "chrome/common/gfx/chrome_canvas.h" +#include "skia/include/SkColor.h" namespace views { @@ -15,5 +17,18 @@ void RootView::UpdateCursor(const MouseEvent& e) { } // TODO(port): Port OnPaint() to not use HWNDs in its public interface. +void RootView::OnPaint(GdkEventExpose* event) { + ChromeCanvasPaint canvas(event); + canvas.FillRectInt(SK_ColorRED, 5, 5, 10, 10); + canvas.FillRectInt(SK_ColorGREEN, 25, 5, 10, 10); + canvas.FillRectInt(SK_ColorBLUE, 45, 5, 10, 10); + + if (!canvas.isEmpty()) { + // const PAINTSTRUCT& ps = canvas.paintStruct(); + // SchedulePaint(gfx::Rect(ps.rcPaint), false); + if (NeedsPainting(false)) + ProcessPaint(&canvas); + } +} } -- cgit v1.1