Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1243)

Unified Diff: skia/ext/canvas_paint_mac.h

Issue 10545050: mac: Use NSWidth() and friends in a few more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: skia/ext/canvas_paint_mac.h
diff --git a/skia/ext/canvas_paint_mac.h b/skia/ext/canvas_paint_mac.h
index 1f5ff03715a3eb54ebddbf73b29e6a754ca82125..441af82e439235422bbf6530471f4f295235223d 100644
--- a/skia/ext/canvas_paint_mac.h
+++ b/skia/ext/canvas_paint_mac.h
@@ -74,7 +74,7 @@ class CanvasPaintT : public T {
// Returns true if the invalid region is empty. The caller should call this
// function to determine if anything needs painting.
bool is_empty() const {
- return rectangle_.size.width == 0 || rectangle_.size.height == 0;
+ return NSIsEmptyRect(rectangle_);
}
const NSRect& rectangle() const {
@@ -84,8 +84,8 @@ class CanvasPaintT : public T {
private:
void init(bool opaque) {
PlatformCanvas* canvas = GetPlatformCanvas(this);
- if (!canvas->initialize(rectangle_.size.width,
- rectangle_.size.height,
+ if (!canvas->initialize(NSWidth(rectangle_),
+ NSHeight(rectangle_),
opaque, NULL)) {
// Cause a deliberate crash;
*(volatile char*) 0 = 0;
@@ -94,8 +94,8 @@ class CanvasPaintT : public T {
// Need to translate so that the dirty region appears at the origin of the
// surface.
- canvas->translate(-SkDoubleToScalar(rectangle_.origin.x),
- -SkDoubleToScalar(rectangle_.origin.y));
+ canvas->translate(-SkDoubleToScalar(NSMinX(rectangle_)),
+ -SkDoubleToScalar(NSMinY(rectangle_)));
context_ = GetBitmapContext(GetTopDevice(*canvas));
}

Powered by Google App Engine
This is Rietveld 408576698