| Index: ui/gfx/canvas.cc
|
| diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
|
| index e8d6a9166fb1136c5d94fca30912b80f137a01be..6ea067eb696ca04b86a44bf4ce2473a22a810bd5 100644
|
| --- a/ui/gfx/canvas.cc
|
| +++ b/ui/gfx/canvas.cc
|
| @@ -12,6 +12,7 @@
|
| #include "third_party/skia/include/core/SkBitmap.h"
|
| #include "third_party/skia/include/effects/SkGradientShader.h"
|
| #include "ui/gfx/font_list.h"
|
| +#include "ui/gfx/geometry/rect_conversions.h"
|
| #include "ui/gfx/rect.h"
|
| #include "ui/gfx/size_conversions.h"
|
| #include "ui/gfx/skia_util.h"
|
| @@ -209,9 +210,12 @@ bool Canvas::IsClipEmpty() const {
|
|
|
| bool Canvas::GetClipBounds(Rect* bounds) {
|
| SkRect out;
|
| - bool has_non_empty_clip = canvas_->getClipBounds(&out);
|
| - bounds->SetRect(out.left(), out.top(), out.width(), out.height());
|
| - return has_non_empty_clip;
|
| + if (canvas_->getClipBounds(&out)) {
|
| + *bounds = ToEnclosingRect(SkRectToRectF(out));
|
| + return true;
|
| + }
|
| + *bounds = gfx::Rect();
|
| + return false;
|
| }
|
|
|
| void Canvas::Translate(const Vector2d& offset) {
|
|
|