| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 } | 945 } |
| 946 | 946 |
| 947 bool SkCanvas::isDrawingToLayer() const { | 947 bool SkCanvas::isDrawingToLayer() const { |
| 948 return fSaveLayerCount > 0; | 948 return fSaveLayerCount > 0; |
| 949 } | 949 } |
| 950 | 950 |
| 951 ///////////////////////////////////////////////////////////////////////////// | 951 ///////////////////////////////////////////////////////////////////////////// |
| 952 | 952 |
| 953 // can't draw it if its empty, or its too big for a fixed-point width or height | 953 // can't draw it if its empty, or its too big for a fixed-point width or height |
| 954 static bool reject_bitmap(const SkBitmap& bitmap) { | 954 static bool reject_bitmap(const SkBitmap& bitmap) { |
| 955 return bitmap.width() <= 0 || bitmap.height() <= 0 | 955 return bitmap.width() <= 0 || bitmap.height() <= 0; |
| 956 #ifndef SK_ALLOW_OVER_32K_BITMAPS | |
| 957 || bitmap.width() > 32767 || bitmap.height() > 32767 | |
| 958 #endif | |
| 959 ; | |
| 960 } | 956 } |
| 961 | 957 |
| 962 void SkCanvas::internalDrawBitmap(const SkBitmap& bitmap, const SkIRect* srcRect
, | 958 void SkCanvas::internalDrawBitmap(const SkBitmap& bitmap, const SkIRect* srcRect
, |
| 963 const SkMatrix& matrix, const SkPaint* paint) { | 959 const SkMatrix& matrix, const SkPaint* paint) { |
| 964 if (reject_bitmap(bitmap)) { | 960 if (reject_bitmap(bitmap)) { |
| 965 return; | 961 return; |
| 966 } | 962 } |
| 967 | 963 |
| 968 SkLazyPaint lazy; | 964 SkLazyPaint lazy; |
| 969 if (NULL == paint) { | 965 if (NULL == paint) { |
| (...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2221 return *paint; | 2217 return *paint; |
| 2222 } | 2218 } |
| 2223 | 2219 |
| 2224 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } | 2220 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } |
| 2225 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } | 2221 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } |
| 2226 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } | 2222 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } |
| 2227 | 2223 |
| 2228 /////////////////////////////////////////////////////////////////////////////// | 2224 /////////////////////////////////////////////////////////////////////////////// |
| 2229 | 2225 |
| 2230 SkCanvas::ClipVisitor::~ClipVisitor() { } | 2226 SkCanvas::ClipVisitor::~ClipVisitor() { } |
| OLD | NEW |