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

Side by Side Diff: src/utils/SkDeferredCanvas.cpp

Issue 2257023003: Plumb drawArc to SkDevice (Closed) Base URL: https://chromium.googlesource.com/skia.git@distance
Patch Set: Address comments Created 4 years, 4 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 | « src/utils/SkDeferredCanvas.h ('k') | src/utils/SkDumpCanvas.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 2016 Google Inc. 2 * Copyright 2016 Google Inc.
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 "SkDeferredCanvas.h" 8 #include "SkDeferredCanvas.h"
9 #include "SkDrawable.h" 9 #include "SkDrawable.h"
10 #include "SkPath.h" 10 #include "SkPath.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 this->flush_check(&modRect, &paint); 317 this->flush_check(&modRect, &paint);
318 fCanvas->drawRect(modRect, paint); 318 fCanvas->drawRect(modRect, paint);
319 } 319 }
320 320
321 void SkDeferredCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) { 321 void SkDeferredCanvas::onDrawOval(const SkRect& rect, const SkPaint& paint) {
322 SkRect modRect = rect; 322 SkRect modRect = rect;
323 this->flush_check(&modRect, &paint, kNoClip_Flag); 323 this->flush_check(&modRect, &paint, kNoClip_Flag);
324 fCanvas->drawOval(modRect, paint); 324 fCanvas->drawOval(modRect, paint);
325 } 325 }
326 326
327 void SkDeferredCanvas::onDrawArc(const SkRect& rect, SkScalar startAngle, SkScal ar sweepAngle,
328 bool useCenter, const SkPaint& paint) {
329 SkRect modRect = rect;
330 this->flush_check(&modRect, &paint, kNoClip_Flag);
331 fCanvas->drawArc(modRect, startAngle, sweepAngle, useCenter, paint);
332 }
333
327 static SkRRect make_offset(const SkRRect& src, SkScalar dx, SkScalar dy) { 334 static SkRRect make_offset(const SkRRect& src, SkScalar dx, SkScalar dy) {
328 SkRRect dst = src; 335 SkRRect dst = src;
329 dst.offset(dx, dy); 336 dst.offset(dx, dy);
330 return dst; 337 return dst;
331 } 338 }
332 339
333 void SkDeferredCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) { 340 void SkDeferredCanvas::onDrawRRect(const SkRRect& rrect, const SkPaint& paint) {
334 SkRect modRect = rrect.getBounds(); 341 SkRect modRect = rrect.getBounds();
335 this->flush_check(&modRect, &paint, kNoClip_Flag); 342 this->flush_check(&modRect, &paint, kNoClip_Flag);
336 fCanvas->drawRRect(make_offset(rrect, 343 fCanvas->drawRRect(make_offset(rrect,
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 return true; 543 return true;
537 } 544 }
538 return false; 545 return false;
539 } 546 }
540 SkImageInfo SkDeferredCanvas::onImageInfo() const { return fCanvas->imageInfo(); } 547 SkImageInfo SkDeferredCanvas::onImageInfo() const { return fCanvas->imageInfo(); }
541 bool SkDeferredCanvas::onGetProps(SkSurfaceProps* props) const { return fCanvas- >getProps(props); } 548 bool SkDeferredCanvas::onGetProps(SkSurfaceProps* props) const { return fCanvas- >getProps(props); }
542 void SkDeferredCanvas::onFlush() { 549 void SkDeferredCanvas::onFlush() {
543 this->flush_all(); 550 this->flush_all();
544 return fCanvas->flush(); 551 return fCanvas->flush();
545 } 552 }
OLDNEW
« no previous file with comments | « src/utils/SkDeferredCanvas.h ('k') | src/utils/SkDumpCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698