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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 2286693002: drawRegion() cleanups (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 // These need to stop being virtual -- clients need to override the onDraw... ve rsions 1968 // These need to stop being virtual -- clients need to override the onDraw... ve rsions
1969 1969
1970 void SkCanvas::drawPaint(const SkPaint& paint) { 1970 void SkCanvas::drawPaint(const SkPaint& paint) {
1971 this->onDrawPaint(paint); 1971 this->onDrawPaint(paint);
1972 } 1972 }
1973 1973
1974 void SkCanvas::drawRect(const SkRect& r, const SkPaint& paint) { 1974 void SkCanvas::drawRect(const SkRect& r, const SkPaint& paint) {
1975 this->onDrawRect(r, paint); 1975 this->onDrawRect(r, paint);
1976 } 1976 }
1977 1977
1978 void SkCanvas::drawRegion(const SkRegion& region, const SkPaint& paint) {
1979 if (region.isEmpty()) {
1980 return;
1981 }
1982
1983 if (region.isRect()) {
1984 return this->drawIRect(region.getBounds(), paint);
1985 }
1986
1987 this->onDrawRegion(region, paint);
1988 }
1989
1978 void SkCanvas::drawOval(const SkRect& r, const SkPaint& paint) { 1990 void SkCanvas::drawOval(const SkRect& r, const SkPaint& paint) {
1979 this->onDrawOval(r, paint); 1991 this->onDrawOval(r, paint);
1980 } 1992 }
1981 1993
1982 void SkCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { 1994 void SkCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
1983 this->onDrawRRect(rrect, paint); 1995 this->onDrawRRect(rrect, paint);
1984 } 1996 }
1985 1997
1986 void SkCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], con st SkPaint& paint) { 1998 void SkCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], con st SkPaint& paint) {
1987 this->onDrawPoints(mode, count, pts, paint); 1999 this->onDrawPoints(mode, count, pts, paint);
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after
3435 3447
3436 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3448 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3437 fCanvas->restoreToCount(fSaveCount); 3449 fCanvas->restoreToCount(fSaveCount);
3438 } 3450 }
3439 3451
3440 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3452 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3441 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3453 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3442 return this->makeSurface(info, props).release(); 3454 return this->makeSurface(info, props).release();
3443 } 3455 }
3444 #endif 3456 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698