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

Side by Side Diff: include/core/SkDevice.h

Issue 1491293002: detect when we can filter bitmaps/images directly, w/o a tmp layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 2010 The Android Open Source Project 2 * Copyright 2010 The Android Open Source Project
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 #ifndef SkDevice_DEFINED 8 #ifndef SkDevice_DEFINED
9 #define SkDevice_DEFINED 9 #define SkDevice_DEFINED
10 10
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 } 367 }
368 368
369 private: 369 private:
370 friend class SkCanvas; 370 friend class SkCanvas;
371 friend struct DeviceCM; //for setMatrixClip 371 friend struct DeviceCM; //for setMatrixClip
372 friend class SkDraw; 372 friend class SkDraw;
373 friend class SkDrawIter; 373 friend class SkDrawIter;
374 friend class SkDeviceFilteredPaint; 374 friend class SkDeviceFilteredPaint;
375 friend class SkImageFilter::DeviceProxy; 375 friend class SkImageFilter::DeviceProxy;
376 friend class SkNoPixelsBitmapDevice; 376 friend class SkNoPixelsBitmapDevice;
377 friend class SkSurface_Raster;
377 378
378 friend class SkSurface_Raster; 379 /**
380 * Returns true if the caller can call the imagefilter "directly" on the sr c bitmap,
381 * without needing to first draw it into a temp layer.
382 *
383 * The conditions are:
384 * - the paint has an imagefilter
385 * - the matrix is only translate (or identity)
386 * - the device itself does not want to handle the filter
Stephen White 2015/12/02 23:45:15 So this will only work for the raster path, then?
reed1 2015/12/03 21:26:51 Fixed.
387 *
388 * If all of the above are true, the caller may call filterSprite()
389 */
390 bool canCallFilterSprite(const SkMatrix*, const SkPaint&);
391
392 /**
393 * Will invoke the paint's imagefilter directly on the bitmap, and draw the result.
394 * Assumes that the caller has previously called canCallFilterSprite().
395 */
396 void filterSprite(const SkDraw&, const SkBitmap&, int x, int y, const SkPain t&);
379 397
380 // used to change the backend's pixels (and possibly config/rowbytes) 398 // used to change the backend's pixels (and possibly config/rowbytes)
381 // but cannot change the width/height, so there should be no change to 399 // but cannot change the width/height, so there should be no change to
382 // any clip information. 400 // any clip information.
383 // TODO: move to SkBitmapDevice 401 // TODO: move to SkBitmapDevice
384 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {} 402 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {}
385 403
386 virtual bool forceConservativeRasterClip() const { return false; } 404 virtual bool forceConservativeRasterClip() const { return false; }
387 405
388 // just called by SkCanvas when built as a layer 406 // just called by SkCanvas when built as a layer
(...skipping 10 matching lines...) Expand all
399 SkSurfaceProps fSurfaceProps; 417 SkSurfaceProps fSurfaceProps;
400 418
401 #ifdef SK_DEBUG 419 #ifdef SK_DEBUG
402 bool fAttachedToCanvas; 420 bool fAttachedToCanvas;
403 #endif 421 #endif
404 422
405 typedef SkRefCnt INHERITED; 423 typedef SkRefCnt INHERITED;
406 }; 424 };
407 425
408 #endif 426 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698