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

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

Issue 2281653002: Respecify SkCanvas::drawArc, consolidate conversion to SkPath, add GM for oddball drawArcs (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: update 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') | src/core/SkDevice.cpp » ('j') | 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 3080 matching lines...) Expand 10 before | Expand all | Expand 10 after
3091 this->drawRRect(rrect, paint); 3091 this->drawRRect(rrect, paint);
3092 } else { 3092 } else {
3093 this->drawRect(r, paint); 3093 this->drawRect(r, paint);
3094 } 3094 }
3095 } 3095 }
3096 3096
3097 void SkCanvas::drawArc(const SkRect& oval, SkScalar startAngle, 3097 void SkCanvas::drawArc(const SkRect& oval, SkScalar startAngle,
3098 SkScalar sweepAngle, bool useCenter, 3098 SkScalar sweepAngle, bool useCenter,
3099 const SkPaint& paint) { 3099 const SkPaint& paint) {
3100 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawArc()"); 3100 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawArc()");
3101 if (SkScalarAbs(sweepAngle) >= SkIntToScalar(360)) { 3101 if (oval.isEmpty() || !sweepAngle) {
3102 this->drawOval(oval, paint); 3102 return;
3103 } else {
3104 this->onDrawArc(oval, startAngle, sweepAngle, useCenter, paint);
3105 } 3103 }
3104 this->onDrawArc(oval, startAngle, sweepAngle, useCenter, paint);
3106 } 3105 }
3107 3106
3108 void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength, 3107 void SkCanvas::drawTextOnPathHV(const void* text, size_t byteLength,
3109 const SkPath& path, SkScalar hOffset, 3108 const SkPath& path, SkScalar hOffset,
3110 SkScalar vOffset, const SkPaint& paint) { 3109 SkScalar vOffset, const SkPaint& paint) {
3111 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextOnPathHV()"); 3110 TRACE_EVENT0("disabled-by-default-skia", "SkCanvas::drawTextOnPathHV()");
3112 SkMatrix matrix; 3111 SkMatrix matrix;
3113 3112
3114 matrix.setTranslate(hOffset, vOffset); 3113 matrix.setTranslate(hOffset, vOffset);
3115 this->drawTextOnPath(text, byteLength, path, &matrix, paint); 3114 this->drawTextOnPath(text, byteLength, path, &matrix, paint);
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3416 3415
3417 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3416 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3418 fCanvas->restoreToCount(fSaveCount); 3417 fCanvas->restoreToCount(fSaveCount);
3419 } 3418 }
3420 3419
3421 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3420 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3422 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3421 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3423 return this->makeSurface(info, props).release(); 3422 return this->makeSurface(info, props).release();
3424 } 3423 }
3425 #endif 3424 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698