OLD | NEW |
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 "SkPDFDevice.h" | 8 #include "SkPDFDevice.h" |
9 | 9 |
10 #include "SkAnnotation.h" | 10 #include "SkAnnotation.h" |
(...skipping 2016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2027 } | 2027 } |
2028 return resourceIndex; | 2028 return resourceIndex; |
2029 } | 2029 } |
2030 | 2030 |
2031 void SkPDFDevice::internalDrawBitmap(const SkMatrix& matrix, | 2031 void SkPDFDevice::internalDrawBitmap(const SkMatrix& matrix, |
2032 const SkClipStack* clipStack, | 2032 const SkClipStack* clipStack, |
2033 const SkRegion& clipRegion, | 2033 const SkRegion& clipRegion, |
2034 const SkBitmap& bitmap, | 2034 const SkBitmap& bitmap, |
2035 const SkIRect* srcRect, | 2035 const SkIRect* srcRect, |
2036 const SkPaint& paint) { | 2036 const SkPaint& paint) { |
| 2037 // TODO(edisonn): Perspective matrix support implemented here |
2037 SkMatrix scaled; | 2038 SkMatrix scaled; |
2038 // Adjust for origin flip. | 2039 // Adjust for origin flip. |
2039 scaled.setScale(SK_Scalar1, -SK_Scalar1); | 2040 scaled.setScale(SK_Scalar1, -SK_Scalar1); |
2040 scaled.postTranslate(0, SK_Scalar1); | 2041 scaled.postTranslate(0, SK_Scalar1); |
2041 // Scale the image up from 1x1 to WxH. | 2042 // Scale the image up from 1x1 to WxH. |
2042 SkIRect subset = SkIRect::MakeWH(bitmap.width(), bitmap.height()); | 2043 SkIRect subset = SkIRect::MakeWH(bitmap.width(), bitmap.height()); |
2043 scaled.postScale(SkIntToScalar(subset.width()), | 2044 scaled.postScale(SkIntToScalar(subset.width()), |
2044 SkIntToScalar(subset.height())); | 2045 SkIntToScalar(subset.height())); |
2045 scaled.postConcat(matrix); | 2046 scaled.postConcat(matrix); |
2046 ScopedContentEntry content(this, clipStack, clipRegion, scaled, paint); | 2047 ScopedContentEntry content(this, clipStack, clipRegion, scaled, paint); |
(...skipping 16 matching lines...) Expand all Loading... |
2063 } | 2064 } |
2064 | 2065 |
2065 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, | 2066 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, |
2066 SkCanvas::Config8888) { | 2067 SkCanvas::Config8888) { |
2067 return false; | 2068 return false; |
2068 } | 2069 } |
2069 | 2070 |
2070 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { | 2071 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { |
2071 return false; | 2072 return false; |
2072 } | 2073 } |
OLD | NEW |