1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h"
7 #include "ui/gfx/canvas.h"
8 #include "ui/gfx/canvas_skia_paint.h"
9 #include "ui/gfx/rect.h"
13 #if !defined(USE_AURA)
14 class CanvasPaintWin
: public gfx::CanvasPaint
, public gfx::CanvasSkiaPaint
{
16 explicit CanvasPaintWin(gfx::NativeView view
);
17 virtual ~CanvasPaintWin();
19 // Overridden from CanvasPaint:
20 virtual bool IsValid() const OVERRIDE
;
21 virtual gfx::Rect
GetInvalidRect() const OVERRIDE
;
22 virtual gfx::Canvas
* AsCanvas() OVERRIDE
;
25 DISALLOW_COPY_AND_ASSIGN(CanvasPaintWin
);
28 CanvasPaintWin::CanvasPaintWin(gfx::NativeView view
)
29 : gfx::CanvasSkiaPaint(view
) {}
31 CanvasPaintWin::~CanvasPaintWin() {}
33 bool CanvasPaintWin::IsValid() const {
37 gfx::Rect
CanvasPaintWin::GetInvalidRect() const {
38 return gfx::Rect(paintStruct().rcPaint
);
41 gfx::Canvas
* CanvasPaintWin::AsCanvas() {
50 CanvasPaint
* CanvasPaint::CreateCanvasPaint(gfx::NativeView view
) {
51 #if !defined(USE_AURA)
52 return new CanvasPaintWin(view
);