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

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

Issue 1652053004: Add Histogram Macros to Skia (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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
« include/config/SkUserConfig.h ('K') | « src/gpu/SkGpuDevice.cpp ('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 2015 Google Inc. 2 * Copyright 2015 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 "GrBlurUtils.h" 10 #include "GrBlurUtils.h"
11 #include "GrCaps.h" 11 #include "GrCaps.h"
12 #include "GrDrawContext.h" 12 #include "GrDrawContext.h"
13 #include "GrStrokeInfo.h" 13 #include "GrStrokeInfo.h"
14 #include "GrTextureParamsAdjuster.h" 14 #include "GrTextureParamsAdjuster.h"
15 #include "SkDraw.h" 15 #include "SkDraw.h"
16 #include "SkGrPriv.h" 16 #include "SkGrPriv.h"
17 #include "SkHistogramLogging.h"
17 #include "SkMaskFilter.h" 18 #include "SkMaskFilter.h"
18 #include "effects/GrBicubicEffect.h" 19 #include "effects/GrBicubicEffect.h"
19 #include "effects/GrSimpleTextureEffect.h" 20 #include "effects/GrSimpleTextureEffect.h"
20 #include "effects/GrTextureDomain.h" 21 #include "effects/GrTextureDomain.h"
21 22
22 static inline bool use_shader(bool textureIsAlphaOnly, const SkPaint& paint) { 23 static inline bool use_shader(bool textureIsAlphaOnly, const SkPaint& paint) {
23 return textureIsAlphaOnly && paint.getShader(); 24 return textureIsAlphaOnly && paint.getShader();
24 } 25 }
25 26
26 ////////////////////////////////////////////////////////////////////////////// 27 //////////////////////////////////////////////////////////////////////////////
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 88
88 ////////////////////////////////////////////////////////////////////////////// 89 //////////////////////////////////////////////////////////////////////////////
89 90
90 void SkGpuDevice::drawTextureProducer(GrTextureProducer* producer, 91 void SkGpuDevice::drawTextureProducer(GrTextureProducer* producer,
91 const SkRect* srcRect, 92 const SkRect* srcRect,
92 const SkRect* dstRect, 93 const SkRect* dstRect,
93 SkCanvas::SrcRectConstraint constraint, 94 SkCanvas::SrcRectConstraint constraint,
94 const SkMatrix& viewMatrix, 95 const SkMatrix& viewMatrix,
95 const GrClip& clip, 96 const GrClip& clip,
96 const SkPaint& paint) { 97 const SkPaint& paint) {
98 // This is the funnel for all non-tiled bitmap/image draw calls. Log a histo gram entry.
99 SK_HISTOGRAM_BOOLEAN("DrawTiled", false);
100
97 // Figure out the actual dst and src rect by clipping the src rect to the bo unds of the 101 // Figure out the actual dst and src rect by clipping the src rect to the bo unds of the
98 // adjuster. If the src rect is clipped then the dst rect must be recomputed . Also determine 102 // adjuster. If the src rect is clipped then the dst rect must be recomputed . Also determine
99 // the matrix that maps the src rect to the dst rect. 103 // the matrix that maps the src rect to the dst rect.
100 SkRect clippedSrcRect; 104 SkRect clippedSrcRect;
101 SkRect clippedDstRect; 105 SkRect clippedDstRect;
102 const SkRect srcBounds = SkRect::MakeIWH(producer->width(), producer->height ()); 106 const SkRect srcBounds = SkRect::MakeIWH(producer->width(), producer->height ());
103 SkMatrix srcToDstMatrix; 107 SkMatrix srcToDstMatrix;
104 if (srcRect) { 108 if (srcRect) {
105 if (!dstRect) { 109 if (!dstRect) {
106 dstRect = &srcBounds; 110 dstRect = &srcBounds;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 rrect)) { 234 rrect)) {
231 return; 235 return;
232 } 236 }
233 SkPath rectPath; 237 SkPath rectPath;
234 rectPath.addRect(clippedDstRect); 238 rectPath.addRect(clippedDstRect);
235 rectPath.setIsVolatile(true); 239 rectPath.setIsVolatile(true);
236 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip, 240 GrBlurUtils::drawPathWithMaskFilter(this->context(), fDrawContext, fClip,
237 rectPath, &grPaint, viewMatrix, mf, pain t.getPathEffect(), 241 rectPath, &grPaint, viewMatrix, mf, pain t.getPathEffect(),
238 GrStrokeInfo::FillInfo(), true); 242 GrStrokeInfo::FillInfo(), true);
239 } 243 }
OLDNEW
« include/config/SkUserConfig.h ('K') | « src/gpu/SkGpuDevice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698