summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-10 20:59:51 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-10 20:59:51 +0000
commit9086321850ac5f639f6d741c53e83aca5796f89a (patch)
tree5732c1806ba6face9b4c76ede54dba75af07a29f /ui
parent6a95711c6b60866b0b810d9fcc7503806f44dbf0 (diff)
downloadchromium_src-9086321850ac5f639f6d741c53e83aca5796f89a.zip
chromium_src-9086321850ac5f639f6d741c53e83aca5796f89a.tar.gz
chromium_src-9086321850ac5f639f6d741c53e83aca5796f89a.tar.bz2
Changed bit interface to use SkCanvas instead of skia::PlatformCanvas, which is being deprecated.
TEST=compile chrome. Review URL: http://codereview.chromium.org/7003123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/blit.cc20
-rw-r--r--ui/gfx/blit.h16
2 files changed, 19 insertions, 17 deletions
diff --git a/ui/gfx/blit.cc b/ui/gfx/blit.cc
index a9eeef8..f98439b 100644
--- a/ui/gfx/blit.cc
+++ b/ui/gfx/blit.cc
@@ -7,7 +7,6 @@
#include "base/logging.h"
#include "build/build_config.h"
#include "skia/ext/platform_canvas.h"
-#include "skia/ext/platform_device.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
@@ -25,7 +24,7 @@ namespace {
// Returns true if the given canvas has any part of itself clipped out or
// any non-identity tranform.
-bool HasClipOrTransform(const skia::PlatformCanvas& canvas) {
+bool HasClipOrTransform(const SkCanvas& canvas) {
if (!canvas.getTotalMatrix().isIdentity())
return true;
@@ -91,10 +90,11 @@ void BlitContextToContext(NativeDrawingContext dst_context,
#endif
}
-void BlitContextToCanvas(skia::PlatformCanvas *dst_canvas,
+void BlitContextToCanvas(SkCanvas *dst_canvas,
const Rect& dst_rect,
NativeDrawingContext src_context,
const Point& src_origin) {
+ DCHECK(skia::SupportsPlatformPaint(dst_canvas));
BlitContextToContext(skia::BeginPlatformPaint(dst_canvas), dst_rect,
src_context, src_origin);
skia::EndPlatformPaint(dst_canvas);
@@ -102,17 +102,20 @@ void BlitContextToCanvas(skia::PlatformCanvas *dst_canvas,
void BlitCanvasToContext(NativeDrawingContext dst_context,
const Rect& dst_rect,
- skia::PlatformCanvas *src_canvas,
+ SkCanvas *src_canvas,
const Point& src_origin) {
+ DCHECK(skia::SupportsPlatformPaint(src_canvas));
BlitContextToContext(dst_context, dst_rect,
skia::BeginPlatformPaint(src_canvas), src_origin);
skia::EndPlatformPaint(src_canvas);
}
-void BlitCanvasToCanvas(skia::PlatformCanvas *dst_canvas,
+void BlitCanvasToCanvas(SkCanvas *dst_canvas,
const Rect& dst_rect,
- skia::PlatformCanvas *src_canvas,
+ SkCanvas *src_canvas,
const Point& src_origin) {
+ DCHECK(skia::SupportsPlatformPaint(dst_canvas));
+ DCHECK(skia::SupportsPlatformPaint(src_canvas));
BlitContextToContext(skia::BeginPlatformPaint(dst_canvas), dst_rect,
skia::BeginPlatformPaint(src_canvas), src_origin);
skia::EndPlatformPaint(src_canvas);
@@ -121,10 +124,11 @@ void BlitCanvasToCanvas(skia::PlatformCanvas *dst_canvas,
#if defined(OS_WIN)
-void ScrollCanvas(skia::PlatformCanvas* canvas,
+void ScrollCanvas(SkCanvas* canvas,
const gfx::Rect& clip,
const gfx::Point& amount) {
DCHECK(!HasClipOrTransform(*canvas)); // Don't support special stuff.
+ DCHECK(skia::SupportsPlatformPaint(canvas));
skia::ScopedPlatformPaint scoped_platform_paint(canvas);
HDC hdc = scoped_platform_paint.GetPlatformSurface();
@@ -138,7 +142,7 @@ void ScrollCanvas(skia::PlatformCanvas* canvas,
// use platform scroll code, but it's complex so we just use the same path
// here. Either way it will be software-only, so it shouldn't matter much.
-void ScrollCanvas(skia::PlatformCanvas* canvas,
+void ScrollCanvas(SkCanvas* canvas,
const gfx::Rect& in_clip,
const gfx::Point& amount) {
DCHECK(!HasClipOrTransform(*canvas)); // Don't support special stuff.
diff --git a/ui/gfx/blit.h b/ui/gfx/blit.h
index dc5a3a9..da69870 100644
--- a/ui/gfx/blit.h
+++ b/ui/gfx/blit.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,9 +8,7 @@
#include "ui/gfx/native_widget_types.h"
-namespace skia {
-class PlatformCanvas;
-} // namespace skia
+class SkCanvas;
namespace gfx {
@@ -24,7 +22,7 @@ void BlitContextToContext(NativeDrawingContext dst_context,
const Point& src_origin);
// Blits a rectangle from the source context into the destination canvas.
-void BlitContextToCanvas(skia::PlatformCanvas *dst_canvas,
+void BlitContextToCanvas(SkCanvas *dst_canvas,
const Rect& dst_rect,
NativeDrawingContext src_context,
const Point& src_origin);
@@ -32,19 +30,19 @@ void BlitContextToCanvas(skia::PlatformCanvas *dst_canvas,
// Blits a rectangle from the source canvas into the destination context.
void BlitCanvasToContext(NativeDrawingContext dst_context,
const Rect& dst_rect,
- skia::PlatformCanvas *src_canvas,
+ SkCanvas *src_canvas,
const Point& src_origin);
// Blits a rectangle from the source canvas into the destination canvas.
-void BlitCanvasToCanvas(skia::PlatformCanvas *dst_canvas,
+void BlitCanvasToCanvas(SkCanvas *dst_canvas,
const Rect& dst_rect,
- skia::PlatformCanvas *src_canvas,
+ SkCanvas *src_canvas,
const Point& src_origin);
// Scrolls the given subset of the given canvas by the given amount.
// The canvas should not have a clip or a transform applied, since platforms
// may implement those operations differently.
-void ScrollCanvas(skia::PlatformCanvas* canvas,
+void ScrollCanvas(SkCanvas* canvas,
const Rect& clip,
const Point& amount);