OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 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 #include "SkBitmapDevice.h" | 8 #include "SkBitmapDevice.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkCanvasPriv.h" | 10 #include "SkCanvasPriv.h" |
(...skipping 1843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 SkRect deviceRect; | 1854 SkRect deviceRect; |
1855 matrix.mapRect(&deviceRect, src); | 1855 matrix.mapRect(&deviceRect, src); |
1856 return !deviceRect.isFinite() || !deviceRect.intersect(deviceClip); | 1856 return !deviceRect.isFinite() || !deviceRect.intersect(deviceClip); |
1857 } | 1857 } |
1858 | 1858 |
1859 bool SkCanvas::quickReject(const SkRect& src) const { | 1859 bool SkCanvas::quickReject(const SkRect& src) const { |
1860 #ifdef SK_DEBUG | 1860 #ifdef SK_DEBUG |
1861 // Verify that fDeviceClipBounds are set properly. | 1861 // Verify that fDeviceClipBounds are set properly. |
1862 SkRect tmp = qr_clip_bounds(fMCRec->fRasterClip.getBounds()); | 1862 SkRect tmp = qr_clip_bounds(fMCRec->fRasterClip.getBounds()); |
1863 if (fMCRec->fRasterClip.isEmpty()) { | 1863 if (fMCRec->fRasterClip.isEmpty()) { |
1864 SkASSERT(fDeviceClipBounds.isEmpty() || tmp == fDeviceClipBounds); | 1864 SkASSERT(fDeviceClipBounds.isEmpty()); |
1865 } else { | 1865 } else { |
1866 SkASSERT(tmp == fDeviceClipBounds); | 1866 SkASSERT(tmp == fDeviceClipBounds); |
1867 } | 1867 } |
1868 | 1868 |
1869 // Verify that fConservativeIsScaleTranslate is set properly. | 1869 // Verify that fConservativeIsScaleTranslate is set properly. |
1870 SkASSERT(!fConservativeIsScaleTranslate || fMCRec->fMatrix.isScaleTranslate(
)); | 1870 SkASSERT(!fConservativeIsScaleTranslate || fMCRec->fMatrix.isScaleTranslate(
)); |
1871 #endif | 1871 #endif |
1872 | 1872 |
1873 if (!fConservativeIsScaleTranslate) { | 1873 if (!fConservativeIsScaleTranslate) { |
1874 return quick_reject_slow_path(src, fDeviceClipBounds, fMCRec->fMatrix); | 1874 return quick_reject_slow_path(src, fDeviceClipBounds, fMCRec->fMatrix); |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3231 | 3231 |
3232 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { | 3232 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { |
3233 fCanvas->restoreToCount(fSaveCount); | 3233 fCanvas->restoreToCount(fSaveCount); |
3234 } | 3234 } |
3235 | 3235 |
3236 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API | 3236 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API |
3237 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { | 3237 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p
rops) { |
3238 return this->makeSurface(info, props).release(); | 3238 return this->makeSurface(info, props).release(); |
3239 } | 3239 } |
3240 #endif | 3240 #endif |
OLD | NEW |