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 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 | 1941 |
1942 dstMaskStorage.reset(createFormXObjectFromDevice()); | 1942 dstMaskStorage.reset(createFormXObjectFromDevice()); |
1943 dstMask = dstMaskStorage.get(); | 1943 dstMask = dstMaskStorage.get(); |
1944 } | 1944 } |
1945 drawFormXObjectWithMask(addXObjectResource(dst), dstMask, &clipStack, | 1945 drawFormXObjectWithMask(addXObjectResource(dst), dstMask, &clipStack, |
1946 clipRegion, SkXfermode::kSrcOver_Mode, true); | 1946 clipRegion, SkXfermode::kSrcOver_Mode, true); |
1947 } | 1947 } |
1948 | 1948 |
1949 SkPaint stockPaint; | 1949 SkPaint stockPaint; |
1950 | 1950 |
1951 if (xfermode == SkXfermode::kClear_Mode) { | 1951 if (xfermode == SkXfermode::kSrcATop_Mode) { |
| 1952 ScopedContentEntry content(this, &clipStack, clipRegion, identity, |
| 1953 stockPaint); |
| 1954 if (content.entry()) { |
| 1955 SkPDFUtils::DrawFormXObject(this->addXObjectResource(dst), |
| 1956 &content.entry()->fContent); |
| 1957 } |
| 1958 } else if (xfermode == SkXfermode::kClear_Mode || !srcFormXObject.get()) { |
1952 return; | 1959 return; |
1953 } else if (xfermode == SkXfermode::kSrc_Mode || | 1960 } else if (xfermode == SkXfermode::kSrc_Mode || |
1954 xfermode == SkXfermode::kDstATop_Mode) { | 1961 xfermode == SkXfermode::kDstATop_Mode) { |
1955 ScopedContentEntry content(this, &clipStack, clipRegion, identity, | 1962 ScopedContentEntry content(this, &clipStack, clipRegion, identity, |
1956 stockPaint); | 1963 stockPaint); |
1957 if (content.entry()) { | 1964 if (content.entry()) { |
1958 SkPDFUtils::DrawFormXObject( | 1965 SkPDFUtils::DrawFormXObject( |
1959 this->addXObjectResource(srcFormXObject.get()), | 1966 this->addXObjectResource(srcFormXObject.get()), |
1960 &content.entry()->fContent); | 1967 &content.entry()->fContent); |
1961 } | 1968 } |
1962 if (xfermode == SkXfermode::kSrc_Mode) { | 1969 if (xfermode == SkXfermode::kSrc_Mode) { |
1963 return; | 1970 return; |
1964 } | 1971 } |
1965 } else if (xfermode == SkXfermode::kSrcATop_Mode) { | |
1966 ScopedContentEntry content(this, &clipStack, clipRegion, identity, | |
1967 stockPaint); | |
1968 if (content.entry()) { | |
1969 SkPDFUtils::DrawFormXObject(this->addXObjectResource(dst), | |
1970 &content.entry()->fContent); | |
1971 } | |
1972 } | 1972 } |
1973 | 1973 |
1974 SkASSERT(xfermode == SkXfermode::kSrcIn_Mode || | 1974 SkASSERT(xfermode == SkXfermode::kSrcIn_Mode || |
1975 xfermode == SkXfermode::kDstIn_Mode || | 1975 xfermode == SkXfermode::kDstIn_Mode || |
1976 xfermode == SkXfermode::kSrcOut_Mode || | 1976 xfermode == SkXfermode::kSrcOut_Mode || |
1977 xfermode == SkXfermode::kDstOut_Mode || | 1977 xfermode == SkXfermode::kDstOut_Mode || |
1978 xfermode == SkXfermode::kSrcATop_Mode || | 1978 xfermode == SkXfermode::kSrcATop_Mode || |
1979 xfermode == SkXfermode::kDstATop_Mode || | 1979 xfermode == SkXfermode::kDstATop_Mode || |
1980 xfermode == SkXfermode::kModulate_Mode); | 1980 xfermode == SkXfermode::kModulate_Mode); |
1981 | 1981 |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2304 } | 2304 } |
2305 | 2305 |
2306 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, | 2306 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, |
2307 SkCanvas::Config8888) { | 2307 SkCanvas::Config8888) { |
2308 return false; | 2308 return false; |
2309 } | 2309 } |
2310 | 2310 |
2311 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { | 2311 bool SkPDFDevice::allowImageFilter(SkImageFilter*) { |
2312 return false; | 2312 return false; |
2313 } | 2313 } |
OLD | NEW |