| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 { | 356 { |
| 357 TRACE_EVENT0("skia", "paintSkBitmap"); | 357 TRACE_EVENT0("skia", "paintSkBitmap"); |
| 358 SkPaint paint; | 358 SkPaint paint; |
| 359 paint.setXfermodeMode(compOp); | 359 paint.setXfermodeMode(compOp); |
| 360 paint.setAlpha(platformContext->getNormalizedAlpha()); | 360 paint.setAlpha(platformContext->getNormalizedAlpha()); |
| 361 paint.setLooper(platformContext->getDrawLooper()); | 361 paint.setLooper(platformContext->getDrawLooper()); |
| 362 // only antialias if we're rotated or skewed | 362 // only antialias if we're rotated or skewed |
| 363 paint.setAntiAlias(hasNon90rotation(platformContext)); | 363 paint.setAntiAlias(hasNon90rotation(platformContext)); |
| 364 | 364 |
| 365 ResamplingMode resampling; | 365 ResamplingMode resampling; |
| 366 if (platformContext->isAccelerated()) | 366 if (platformContext->isAccelerated() || platformContext->isDeferred()) |
| 367 resampling = RESAMPLE_LINEAR; | 367 resampling = RESAMPLE_LINEAR; |
| 368 else if (platformContext->printing()) | 368 else if (platformContext->printing()) |
| 369 resampling = RESAMPLE_NONE; | 369 resampling = RESAMPLE_NONE; |
| 370 else { | 370 else { |
| 371 // Take into account scale applied to the canvas when computing sampling
mode (e.g. CSS scale or page scale). | 371 // Take into account scale applied to the canvas when computing sampling
mode (e.g. CSS scale or page scale). |
| 372 SkRect destRectTarget = destRect; | 372 SkRect destRectTarget = destRect; |
| 373 if (!(platformContext->getTotalMatrix().getType() & (SkMatrix::kAffine_M
ask | SkMatrix::kPerspective_Mask))) | 373 if (!(platformContext->getTotalMatrix().getType() & (SkMatrix::kAffine_M
ask | SkMatrix::kPerspective_Mask))) |
| 374 platformContext->getTotalMatrix().mapRect(&destRectTarget, destRect)
; | 374 platformContext->getTotalMatrix().mapRect(&destRectTarget, destRect)
; |
| 375 | 375 |
| 376 resampling = computeResamplingMode(platformContext->getTotalMatrix(), bi
tmap, | 376 resampling = computeResamplingMode(platformContext->getTotalMatrix(), bi
tmap, |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 *bm, | 652 *bm, |
| 653 normSrcRect, | 653 normSrcRect, |
| 654 normDstRect, | 654 normDstRect, |
| 655 WebCoreCompositeToSkiaComposite(compositeOp)); | 655 WebCoreCompositeToSkiaComposite(compositeOp)); |
| 656 | 656 |
| 657 if (ImageObserver* observer = imageObserver()) | 657 if (ImageObserver* observer = imageObserver()) |
| 658 observer->didDraw(this); | 658 observer->didDraw(this); |
| 659 } | 659 } |
| 660 | 660 |
| 661 } // namespace WebCore | 661 } // namespace WebCore |
| OLD | NEW |