summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 23:30:26 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-24 23:30:26 +0000
commita219f823813abcf778eceea2eb81f2d3967009a8 (patch)
treee1a9e06b697d539260472a9faa2ea86d5984a4bf /views/widget
parent755e1b73a0b4894ecc36401fd042c744e7837844 (diff)
downloadchromium_src-a219f823813abcf778eceea2eb81f2d3967009a8.zip
chromium_src-a219f823813abcf778eceea2eb81f2d3967009a8.tar.gz
chromium_src-a219f823813abcf778eceea2eb81f2d3967009a8.tar.bz2
Canvas refactoring part 3.
- Replace Canvas instance users with CanvasSkia users. - Rename Canvas2 to Canvas. - Delete Canvas subclass of CanvasSkia. This has created some ugliness around the fact that people that used SkCanvas methods on Canvas now have to go through AsCanvasSkia first. This is temporary ugliness that will be eradicated as I incrementally build out the new Canvas API. BUG=none TEST=none Review URL: http://codereview.chromium.org/2825018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/root_view.cc8
-rw-r--r--views/widget/root_view_win.cc7
-rw-r--r--views/widget/widget_win.cc7
-rw-r--r--views/widget/widget_win.h4
4 files changed, 12 insertions, 14 deletions
diff --git a/views/widget/root_view.cc b/views/widget/root_view.cc
index ff08d29..d67f5e3 100644
--- a/views/widget/root_view.cc
+++ b/views/widget/root_view.cc
@@ -10,7 +10,7 @@
#include "base/keyboard_codes.h"
#include "base/logging.h"
#include "base/message_loop.h"
-#include "gfx/canvas.h"
+#include "gfx/canvas_skia.h"
#include "views/fill_layout.h"
#include "views/focus/view_storage.h"
#include "views/widget/widget.h"
@@ -173,10 +173,10 @@ void RootView::ProcessPaint(gfx::Canvas* canvas) {
return;
// Clear the background.
- canvas->drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode);
+ canvas->AsCanvasSkia()->drawColor(SK_ColorBLACK, SkXfermode::kClear_Mode);
// Save the current transforms.
- canvas->save();
+ canvas->AsCanvasSkia()->save();
// Set the clip rect according to the invalid rect.
int clip_x = invalid_rect_.x() + x();
@@ -188,7 +188,7 @@ void RootView::ProcessPaint(gfx::Canvas* canvas) {
View::ProcessPaint(canvas);
// Restore the previous transform
- canvas->restore();
+ canvas->AsCanvasSkia()->restore();
ClearPaintRect();
}
diff --git a/views/widget/root_view_win.cc b/views/widget/root_view_win.cc
index 3c9706d..ab885d0 100644
--- a/views/widget/root_view_win.cc
+++ b/views/widget/root_view_win.cc
@@ -9,7 +9,6 @@
#include "app/os_exchange_data_provider_win.h"
#include "base/base_drag_source.h"
#include "base/logging.h"
-#include "gfx/canvas_2.h"
#include "gfx/canvas_skia.h"
namespace views {
@@ -25,12 +24,12 @@ void RootView::OnPaint(HWND hwnd) {
RECT win_version = original_dirty_region.ToRECT();
InvalidateRect(hwnd, &win_version, FALSE);
}
- scoped_ptr<gfx::CanvasPaint2> canvas(
- gfx::CanvasPaint2::CreateCanvasPaint(hwnd));
+ scoped_ptr<gfx::CanvasPaint> canvas(
+ gfx::CanvasPaint::CreateCanvasPaint(hwnd));
if (!canvas->IsValid()) {
SchedulePaint(canvas->GetInvalidRect(), false);
if (NeedsPainting(false))
- ProcessPaint(canvas->AsCanvas2()->AsCanvas());
+ ProcessPaint(canvas->AsCanvas());
}
}
diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc
index 7705784..5948bfd 100644
--- a/views/widget/widget_win.cc
+++ b/views/widget/widget_win.cc
@@ -9,7 +9,6 @@
#include "app/win_util.h"
#include "base/string_util.h"
#include "base/win_util.h"
-#include "gfx/canvas.h"
#include "gfx/canvas_skia.h"
#include "gfx/native_theme_win.h"
#include "gfx/path.h"
@@ -1122,9 +1121,9 @@ Window* WidgetWin::GetWindowImpl(HWND hwnd) {
}
void WidgetWin::SizeContents(const gfx::Size& window_size) {
- contents_.reset(new gfx::Canvas(window_size.width(),
- window_size.height(),
- false));
+ contents_.reset(new gfx::CanvasSkia(window_size.width(),
+ window_size.height(),
+ false));
}
void WidgetWin::PaintLayeredWindow() {
diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h
index 98da389..866cc70 100644
--- a/views/widget/widget_win.h
+++ b/views/widget/widget_win.h
@@ -20,7 +20,7 @@
#include "views/widget/widget.h"
namespace gfx {
-class Canvas;
+class CanvasSkia;
class Rect;
}
@@ -533,7 +533,7 @@ class WidgetWin : public app::WindowImpl,
// A canvas that contains the window contents in the case of a layered
// window.
- scoped_ptr<gfx::Canvas> contents_;
+ scoped_ptr<gfx::CanvasSkia> contents_;
// Whether or not the window should delete itself when it is destroyed.
// Set this to false via its setter for stack allocated instances.