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

Side by Side Diff: src/pipe/SkGPipeWrite.cpp

Issue 23484007: call drawRect to try GrAARectRenderer if the path is a rect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: if the path is a rect, call drawRect in SkCanvas::drawPath for potential accelerated rasterization … Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkAnnotation.h" 9 #include "SkAnnotation.h"
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 virtual bool clipRect(const SkRect&, SkRegion::Op op, bool doAntiAlias = fal se) SK_OVERRIDE; 218 virtual bool clipRect(const SkRect&, SkRegion::Op op, bool doAntiAlias = fal se) SK_OVERRIDE;
219 virtual bool clipRRect(const SkRRect&, SkRegion::Op op, bool doAntiAlias = f alse) SK_OVERRIDE; 219 virtual bool clipRRect(const SkRRect&, SkRegion::Op op, bool doAntiAlias = f alse) SK_OVERRIDE;
220 virtual bool clipPath(const SkPath& path, SkRegion::Op op, 220 virtual bool clipPath(const SkPath& path, SkRegion::Op op,
221 bool doAntiAlias = false) SK_OVERRIDE; 221 bool doAntiAlias = false) SK_OVERRIDE;
222 virtual bool clipRegion(const SkRegion& region, SkRegion::Op op) SK_OVERRIDE ; 222 virtual bool clipRegion(const SkRegion& region, SkRegion::Op op) SK_OVERRIDE ;
223 virtual void clear(SkColor) SK_OVERRIDE; 223 virtual void clear(SkColor) SK_OVERRIDE;
224 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE; 224 virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
225 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[], 225 virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
226 const SkPaint&) SK_OVERRIDE; 226 const SkPaint&) SK_OVERRIDE;
227 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE; 227 virtual void drawOval(const SkRect&, const SkPaint&) SK_OVERRIDE;
228 virtual void drawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE; 228 virtual void onDrawRect(const SkRect& rect, const SkPaint&) SK_OVERRIDE;
229 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE; 229 virtual void drawRRect(const SkRRect&, const SkPaint&) SK_OVERRIDE;
230 virtual void drawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE; 230 virtual void onDrawPath(const SkPath& path, const SkPaint&) SK_OVERRIDE;
231 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top, 231 virtual void drawBitmap(const SkBitmap&, SkScalar left, SkScalar top,
232 const SkPaint*) SK_OVERRIDE; 232 const SkPaint*) SK_OVERRIDE;
233 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src, 233 virtual void drawBitmapRectToRect(const SkBitmap&, const SkRect* src,
234 const SkRect& dst, const SkPaint* paint, 234 const SkRect& dst, const SkPaint* paint,
235 DrawBitmapRectFlags flags) SK_OVERRIDE; 235 DrawBitmapRectFlags flags) SK_OVERRIDE;
236 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&, 236 virtual void drawBitmapMatrix(const SkBitmap&, const SkMatrix&,
237 const SkPaint*) SK_OVERRIDE; 237 const SkPaint*) SK_OVERRIDE;
238 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center, 238 virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
239 const SkRect& dst, const SkPaint* paint = NULL) SK_OVERRIDE; 239 const SkRect& dst, const SkPaint* paint = NULL) SK_OVERRIDE;
240 virtual void drawSprite(const SkBitmap&, int left, int top, 240 virtual void drawSprite(const SkBitmap&, int left, int top,
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 709
710 void SkGPipeCanvas::drawOval(const SkRect& rect, const SkPaint& paint) { 710 void SkGPipeCanvas::drawOval(const SkRect& rect, const SkPaint& paint) {
711 NOTIFY_SETUP(this); 711 NOTIFY_SETUP(this);
712 this->writePaint(paint); 712 this->writePaint(paint);
713 if (this->needOpBytes(sizeof(SkRect))) { 713 if (this->needOpBytes(sizeof(SkRect))) {
714 this->writeOp(kDrawOval_DrawOp); 714 this->writeOp(kDrawOval_DrawOp);
715 fWriter.writeRect(rect); 715 fWriter.writeRect(rect);
716 } 716 }
717 } 717 }
718 718
719 void SkGPipeCanvas::drawRect(const SkRect& rect, const SkPaint& paint) { 719 void SkGPipeCanvas::onDrawRect(const SkRect& rect, const SkPaint& paint) {
720 NOTIFY_SETUP(this); 720 NOTIFY_SETUP(this);
721 this->writePaint(paint); 721 this->writePaint(paint);
722 if (this->needOpBytes(sizeof(SkRect))) { 722 if (this->needOpBytes(sizeof(SkRect))) {
723 this->writeOp(kDrawRect_DrawOp); 723 this->writeOp(kDrawRect_DrawOp);
724 fWriter.writeRect(rect); 724 fWriter.writeRect(rect);
725 } 725 }
726 } 726 }
727 727
728 void SkGPipeCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) { 728 void SkGPipeCanvas::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
729 NOTIFY_SETUP(this); 729 NOTIFY_SETUP(this);
730 this->writePaint(paint); 730 this->writePaint(paint);
731 if (this->needOpBytes(kSizeOfFlatRRect)) { 731 if (this->needOpBytes(kSizeOfFlatRRect)) {
732 this->writeOp(kDrawRRect_DrawOp); 732 this->writeOp(kDrawRRect_DrawOp);
733 fWriter.writeRRect(rrect); 733 fWriter.writeRRect(rrect);
734 } 734 }
735 } 735 }
736 736
737 void SkGPipeCanvas::drawPath(const SkPath& path, const SkPaint& paint) { 737 void SkGPipeCanvas::onDrawPath(const SkPath& path, const SkPaint& paint) {
738 NOTIFY_SETUP(this); 738 NOTIFY_SETUP(this);
739 this->writePaint(paint); 739 this->writePaint(paint);
740 if (this->needOpBytes(path.writeToMemory(NULL))) { 740 if (this->needOpBytes(path.writeToMemory(NULL))) {
741 this->writeOp(kDrawPath_DrawOp); 741 this->writeOp(kDrawPath_DrawOp);
742 fWriter.writePath(path); 742 fWriter.writePath(path);
743 } 743 }
744 } 744 }
745 745
746 bool SkGPipeCanvas::commonDrawBitmap(const SkBitmap& bm, DrawOps op, 746 bool SkGPipeCanvas::commonDrawBitmap(const SkBitmap& bm, DrawOps op,
747 unsigned flags, 747 unsigned flags,
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 fCanvas->ref(); 1191 fCanvas->ref();
1192 } 1192 }
1193 1193
1194 BitmapShuttle::~BitmapShuttle() { 1194 BitmapShuttle::~BitmapShuttle() {
1195 fCanvas->unref(); 1195 fCanvas->unref();
1196 } 1196 }
1197 1197
1198 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) { 1198 bool BitmapShuttle::insert(const SkBitmap& bitmap, int32_t slot) {
1199 return fCanvas->shuttleBitmap(bitmap, slot); 1199 return fCanvas->shuttleBitmap(bitmap, slot);
1200 } 1200 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698