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

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

Issue 2155063002: use special-image for imagefilters and save/restore layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 5 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
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 "SkColorFilter.h" 8 #include "SkColorFilter.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 path.rewind(); 215 path.rewind();
216 path.addPoly(quad, 4, true); 216 path.addPoly(quad, 4, true);
217 path.setConvexity(SkPath::kConvex_Convexity); 217 path.setConvexity(SkPath::kConvex_Convexity);
218 this->drawPath(draw, path, pnt, nullptr, true); 218 this->drawPath(draw, path, pnt, nullptr, true);
219 } 219 }
220 } 220 }
221 221
222 //////////////////////////////////////////////////////////////////////////////// /////////////////// 222 //////////////////////////////////////////////////////////////////////////////// ///////////////////
223 223
224 void SkBaseDevice::drawSpecial(const SkDraw&, SkSpecialImage*, int x, int y, con st SkPaint&) {}
225 sk_sp<SkSpecialImage> SkBaseDevice::makeSpecial(const SkBitmap&) { return nullpt r; }
226 sk_sp<SkSpecialImage> SkBaseDevice::makeSpecial(const SkImage*) { return nullptr ; }
227 sk_sp<SkSpecialImage> SkBaseDevice::asSpecial() { return nullptr; }
228
229 //////////////////////////////////////////////////////////////////////////////// ///////////////////
230
224 bool SkBaseDevice::readPixels(const SkImageInfo& info, void* dstP, size_t rowByt es, int x, int y) { 231 bool SkBaseDevice::readPixels(const SkImageInfo& info, void* dstP, size_t rowByt es, int x, int y) {
225 #ifdef SK_DEBUG 232 #ifdef SK_DEBUG
226 SkASSERT(info.width() > 0 && info.height() > 0); 233 SkASSERT(info.width() > 0 && info.height() > 0);
227 SkASSERT(dstP); 234 SkASSERT(dstP);
228 SkASSERT(rowBytes >= info.minRowBytes()); 235 SkASSERT(rowBytes >= info.minRowBytes());
229 SkASSERT(x >= 0 && y >= 0); 236 SkASSERT(x >= 0 && y >= 0);
230 237
231 const SkImageInfo& srcInfo = this->imageInfo(); 238 const SkImageInfo& srcInfo = this->imageInfo();
232 SkASSERT(x + info.width() <= srcInfo.width()); 239 SkASSERT(x + info.width() <= srcInfo.width());
233 SkASSERT(y + info.height() <= srcInfo.height()); 240 SkASSERT(y + info.height() <= srcInfo.height());
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 545
539 // Also log filter quality independent scale factor. 546 // Also log filter quality independent scale factor.
540 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor, 547 SK_HISTOGRAM_ENUMERATION("DrawScaleFactor.AnyFilterQuality", scaleFactor,
541 kLast_ScaleFactor + 1); 548 kLast_ScaleFactor + 1);
542 549
543 // Also log an overall histogram of filter quality. 550 // Also log an overall histogram of filter quality.
544 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali ty + 1); 551 SK_HISTOGRAM_ENUMERATION("FilterQuality", filterQuality, kLast_SkFilterQuali ty + 1);
545 #endif 552 #endif
546 } 553 }
547 554
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698