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

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

Issue 2236363004: Guard .fVec by !defined(SKNX_NO_SIMD). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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 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 1808 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 1819
1820 bool SkCanvas::isClipEmpty() const { 1820 bool SkCanvas::isClipEmpty() const {
1821 return fMCRec->fRasterClip.isEmpty(); 1821 return fMCRec->fRasterClip.isEmpty();
1822 } 1822 }
1823 1823
1824 bool SkCanvas::isClipRect() const { 1824 bool SkCanvas::isClipRect() const {
1825 return fMCRec->fRasterClip.isRect(); 1825 return fMCRec->fRasterClip.isRect();
1826 } 1826 }
1827 1827
1828 static inline bool is_nan_or_clipped(const Sk4f& devRect, const Sk4f& devClip) { 1828 static inline bool is_nan_or_clipped(const Sk4f& devRect, const Sk4f& devClip) {
1829 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 1829 #if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
1830 __m128 lLtT = _mm_unpacklo_ps(devRect.fVec, devClip.fVec); 1830 __m128 lLtT = _mm_unpacklo_ps(devRect.fVec, devClip.fVec);
1831 __m128 RrBb = _mm_unpackhi_ps(devClip.fVec, devRect.fVec); 1831 __m128 RrBb = _mm_unpackhi_ps(devClip.fVec, devRect.fVec);
1832 __m128 mask = _mm_cmplt_ps(lLtT, RrBb); 1832 __m128 mask = _mm_cmplt_ps(lLtT, RrBb);
1833 return 0xF != _mm_movemask_ps(mask); 1833 return 0xF != _mm_movemask_ps(mask);
1834 #elif defined(SK_ARM_HAS_NEON) 1834 #elif !defined(SKNX_NO_SIMD) && defined(SK_ARM_HAS_NEON)
1835 float32x4_t lLtT = vzipq_f32(devRect.fVec, devClip.fVec).val[0]; 1835 float32x4_t lLtT = vzipq_f32(devRect.fVec, devClip.fVec).val[0];
1836 float32x4_t RrBb = vzipq_f32(devClip.fVec, devRect.fVec).val[1]; 1836 float32x4_t RrBb = vzipq_f32(devClip.fVec, devRect.fVec).val[1];
1837 uint32x4_t mask = vcltq_f32(lLtT, RrBb); 1837 uint32x4_t mask = vcltq_f32(lLtT, RrBb);
1838 return 0xFFFFFFFFFFFFFFFF != (uint64_t) vmovn_u32(mask); 1838 return 0xFFFFFFFFFFFFFFFF != (uint64_t) vmovn_u32(mask);
1839 #else 1839 #else
1840 SkRect devRectAsRect; 1840 SkRect devRectAsRect;
1841 SkRect devClipAsRect; 1841 SkRect devClipAsRect;
1842 devRect.store(&devRectAsRect.fLeft); 1842 devRect.store(&devRectAsRect.fLeft);
1843 devClip.store(&devClipAsRect.fLeft); 1843 devClip.store(&devClipAsRect.fLeft);
1844 return !devRectAsRect.isFinite() || !devRectAsRect.intersect(devClipAsRect); 1844 return !devRectAsRect.isFinite() || !devRectAsRect.intersect(devClipAsRect);
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
2509 if (special) { 2509 if (special) {
2510 SkPoint pt; 2510 SkPoint pt;
2511 iter.fMatrix->mapXY(x, y, &pt); 2511 iter.fMatrix->mapXY(x, y, &pt);
2512 iter.fDevice->drawSpecial(iter, special.get(), 2512 iter.fDevice->drawSpecial(iter, special.get(),
2513 SkScalarRoundToInt(pt.fX), 2513 SkScalarRoundToInt(pt.fX),
2514 SkScalarRoundToInt(pt.fY), pnt); 2514 SkScalarRoundToInt(pt.fY), pnt);
2515 } else { 2515 } else {
2516 iter.fDevice->drawBitmap(iter, bitmap, matrix, looper.paint()); 2516 iter.fDevice->drawBitmap(iter, bitmap, matrix, looper.paint());
2517 } 2517 }
2518 } 2518 }
2519 2519
2520 LOOPER_END 2520 LOOPER_END
2521 } 2521 }
2522 2522
2523 // this one is non-virtual, so it can be called safely by other canvas apis 2523 // this one is non-virtual, so it can be called safely by other canvas apis
2524 void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, 2524 void SkCanvas::internalDrawBitmapRect(const SkBitmap& bitmap, const SkRect* src,
2525 const SkRect& dst, const SkPaint* paint, 2525 const SkRect& dst, const SkPaint* paint,
2526 SrcRectConstraint constraint) { 2526 SrcRectConstraint constraint) {
2527 if (bitmap.drawsNothing() || dst.isEmpty()) { 2527 if (bitmap.drawsNothing() || dst.isEmpty()) {
2528 return; 2528 return;
2529 } 2529 }
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
3355 3355
3356 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3356 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3357 fCanvas->restoreToCount(fSaveCount); 3357 fCanvas->restoreToCount(fSaveCount);
3358 } 3358 }
3359 3359
3360 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API 3360 #ifdef SK_SUPPORT_LEGACY_NEW_SURFACE_API
3361 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) { 3361 SkSurface* SkCanvas::newSurface(const SkImageInfo& info, const SkSurfaceProps* p rops) {
3362 return this->makeSurface(info, props).release(); 3362 return this->makeSurface(info, props).release();
3363 } 3363 }
3364 #endif 3364 #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