diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 22:36:50 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-07 22:36:50 +0000 |
commit | 1b660827946f14bdeec9cd16bc676cf3691af9b6 (patch) | |
tree | 94b3952363e826172e10c08ae4096cce3394fb2d /skia/ext/platform_canvas.cc | |
parent | 495010392f34c5edccd3abaf10c4f45d4d5ab8e2 (diff) | |
download | chromium_src-1b660827946f14bdeec9cd16bc676cf3691af9b6.zip chromium_src-1b660827946f14bdeec9cd16bc676cf3691af9b6.tar.gz chromium_src-1b660827946f14bdeec9cd16bc676cf3691af9b6.tar.bz2 |
skia: Change MakeOpaque() function to take a gfx::Rect parameter.
BUG=100898
R=pkasting@chromium.org
TBR=sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9581040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125473 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/platform_canvas.cc')
-rw-r--r-- | skia/ext/platform_canvas.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/skia/ext/platform_canvas.cc b/skia/ext/platform_canvas.cc index f4510744..09a2319 100644 --- a/skia/ext/platform_canvas.cc +++ b/skia/ext/platform_canvas.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -6,6 +6,8 @@ #include "skia/ext/bitmap_platform_device.h" #include "third_party/skia/include/core/SkTypes.h" +#include "ui/gfx/rect.h" +#include "ui/gfx/skia_util.h" namespace skia { @@ -80,19 +82,16 @@ static SkPMColor MakeOpaqueXfermodeProc(SkPMColor src, SkPMColor dst) { return dst | (0xFF << SK_A32_SHIFT); } -void MakeOpaque(SkCanvas* canvas, int x, int y, int width, int height) { - if (width <= 0 || height <= 0) +void MakeOpaque(SkCanvas* canvas, const gfx::Rect& rect) { + if (rect.IsEmpty()) return; - SkRect rect; - rect.setXYWH(SkIntToScalar(x), SkIntToScalar(y), - SkIntToScalar(width), SkIntToScalar(height)); SkPaint paint; // so we don't draw anything on a device that ignores xfermodes paint.setColor(0); // install our custom mode paint.setXfermode(new SkProcXfermode(MakeOpaqueXfermodeProc))->unref(); - canvas->drawRect(rect, paint); + canvas->drawRect(gfx::RectToSkRect(rect), paint); } } // namespace skia |