| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008, Google Inc. All rights reserved. | 2 * Copyright (c) 2008, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void NativeImageSkia::draw( | 157 void NativeImageSkia::draw( |
| 158 GraphicsContext* context, | 158 GraphicsContext* context, |
| 159 const SkRect& srcRect, | 159 const SkRect& srcRect, |
| 160 const SkRect& destRect, | 160 const SkRect& destRect, |
| 161 CompositeOperator compositeOp, | 161 CompositeOperator compositeOp, |
| 162 WebBlendMode blendMode) const | 162 WebBlendMode blendMode) const |
| 163 { | 163 { |
| 164 TRACE_EVENT0("skia", "NativeImageSkia::draw"); | 164 TRACE_EVENT0("skia", "NativeImageSkia::draw"); |
| 165 | 165 |
| 166 bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap()); | 166 bool isLazyDecoded = DeferredImageDecoder::isLazyDecoded(bitmap()); |
| 167 bool isOpaque = bitmap().isOpaque(); |
| 167 | 168 |
| 168 SkPaint paint; | 169 SkPaint paint; |
| 169 context->preparePaintForDrawRectToRect(&paint, srcRect, destRect, compositeO
p, blendMode, isLazyDecoded, isDataComplete()); | 170 context->preparePaintForDrawRectToRect(&paint, srcRect, destRect, compositeO
p, blendMode, isOpaque, isLazyDecoded, isDataComplete()); |
| 170 // We want to filter it if we decided to do interpolation above, or if | 171 // We want to filter it if we decided to do interpolation above, or if |
| 171 // there is something interesting going on with the matrix (like a rotation)
. | 172 // there is something interesting going on with the matrix (like a rotation)
. |
| 172 // Note: for serialization, we will want to subset the bitmap first so we | 173 // Note: for serialization, we will want to subset the bitmap first so we |
| 173 // don't send extra pixels. | 174 // don't send extra pixels. |
| 174 context->drawBitmapRect(bitmap(), &srcRect, destRect, &paint); | 175 context->drawBitmapRect(bitmap(), &srcRect, destRect, &paint); |
| 175 | 176 |
| 176 if (isLazyDecoded) | 177 if (isLazyDecoded) |
| 177 PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID())
; | 178 PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID())
; |
| 178 context->didDrawRect(destRect, paint, &bitmap()); | 179 context->didDrawRect(destRect, paint, &bitmap()); |
| 179 } | 180 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 SkIRect NativeImageSkia::ImageResourceInfo::rectInSubset(const SkIRect& otherSca
ledImageSubset) | 370 SkIRect NativeImageSkia::ImageResourceInfo::rectInSubset(const SkIRect& otherSca
ledImageSubset) |
| 370 { | 371 { |
| 371 if (!scaledImageSubset.contains(otherScaledImageSubset)) | 372 if (!scaledImageSubset.contains(otherScaledImageSubset)) |
| 372 return SkIRect::MakeEmpty(); | 373 return SkIRect::MakeEmpty(); |
| 373 SkIRect subsetRect = otherScaledImageSubset; | 374 SkIRect subsetRect = otherScaledImageSubset; |
| 374 subsetRect.offset(-scaledImageSubset.x(), -scaledImageSubset.y()); | 375 subsetRect.offset(-scaledImageSubset.x(), -scaledImageSubset.y()); |
| 375 return subsetRect; | 376 return subsetRect; |
| 376 } | 377 } |
| 377 | 378 |
| 378 } // namespace blink | 379 } // namespace blink |
| OLD | NEW |