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

Side by Side Diff: src/gpu/SkGpuDevice.cpp

Issue 1114463002: Pass dashing info from drawPath to Gr side (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | 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 2011 Google Inc. 2 * Copyright 2011 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 "SkGpuDevice.h" 8 #include "SkGpuDevice.h"
9 9
10 #include "GrBitmapTextContext.h" 10 #include "GrBitmapTextContext.h"
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 // at this point we're done with prePathMatrix 819 // at this point we're done with prePathMatrix
820 SkDEBUGCODE(prePathMatrix = (const SkMatrix*)0x50FF8001;) 820 SkDEBUGCODE(prePathMatrix = (const SkMatrix*)0x50FF8001;)
821 821
822 GrPaint grPaint; 822 GrPaint grPaint;
823 if (!SkPaint2GrPaint(this->context(), fRenderTarget, paint, viewMatrix, true , &grPaint)) { 823 if (!SkPaint2GrPaint(this->context(), fRenderTarget, paint, viewMatrix, true , &grPaint)) {
824 return; 824 return;
825 } 825 }
826 826
827 const SkRect* cullRect = NULL; // TODO: what is our bounds? 827 const SkRect* cullRect = NULL; // TODO: what is our bounds?
828 SkStrokeRec* strokePtr = strokeInfo.getStrokeRecPtr(); 828 SkStrokeRec* strokePtr = strokeInfo.getStrokeRecPtr();
829 if (pathEffect && pathEffect->filterPath(effectPath.init(), *pathPtr, stroke Ptr, 829 if (!strokeInfo.isDashed() && pathEffect && pathEffect->filterPath(effectPat h.init(), *pathPtr,
830 cullRect)) { 830 strokePtr , cullRect)) {
831 pathPtr = effectPath.get(); 831 pathPtr = effectPath.get();
832 pathIsMutable = true; 832 pathIsMutable = true;
833 strokeInfo.removeDash();
834 } 833 }
835 834
836 const SkStrokeRec& stroke = strokeInfo.getStrokeRec(); 835 const SkStrokeRec& stroke = strokeInfo.getStrokeRec();
837 if (paint.getMaskFilter()) { 836 if (paint.getMaskFilter()) {
838 if (!stroke.isHairlineStyle()) { 837 if (!stroke.isHairlineStyle()) {
839 SkPath* strokedPath = pathIsMutable ? pathPtr : tmpPath.init(); 838 SkPath* strokedPath = pathIsMutable ? pathPtr : tmpPath.init();
839 if (strokeInfo.isDashed()) {
840 if (pathEffect->filterPath(strokedPath, *pathPtr, strokePtr, cul lRect)) {
841 pathPtr = strokedPath;
842 pathIsMutable = true;
843 }
844 strokeInfo.removeDash();
845 }
840 if (stroke.applyToPath(strokedPath, *pathPtr)) { 846 if (stroke.applyToPath(strokedPath, *pathPtr)) {
egdaniel 2015/04/28 13:25:48 what happens if both these if statements trigger a
Kimmo Kinnunen 2015/04/28 14:12:30 Yeah, the intention is to first apply the dashing
egdaniel 2015/04/28 14:18:19 So if on line 838, if !pathIsMutable then strokedP
egdaniel 2015/04/28 14:20:09 oh wait I am missing a line. woops ignore all my s
841 pathPtr = strokedPath; 847 pathPtr = strokedPath;
842 pathIsMutable = true; 848 pathIsMutable = true;
843 strokeInfo.setFillStyle(); 849 strokeInfo.setFillStyle();
844 } 850 }
845 } 851 }
846 852
847 // avoid possibly allocating a new path in transform if we can 853 // avoid possibly allocating a new path in transform if we can
848 SkPath* devPathPtr = pathIsMutable ? pathPtr : tmpPath.init(); 854 SkPath* devPathPtr = pathIsMutable ? pathPtr : tmpPath.init();
849 if (!pathIsMutable) { 855 if (!pathIsMutable) {
850 devPathPtr->setIsVolatile(true); 856 devPathPtr->setIsVolatile(true);
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after
2033 #endif 2039 #endif
2034 } 2040 }
2035 2041
2036 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() { 2042 SkImageFilter::Cache* SkGpuDevice::getImageFilterCache() {
2037 // We always return a transient cache, so it is freed after each 2043 // We always return a transient cache, so it is freed after each
2038 // filter traversal. 2044 // filter traversal.
2039 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize); 2045 return SkImageFilter::Cache::Create(kDefaultImageFilterCacheSize);
2040 } 2046 }
2041 2047
2042 #endif 2048 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698