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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 SkPaint paint; | 63 SkPaint paint; |
64 context->preparePaintForDrawRectToRect(&paint, srcRect, destRect, compositeO
p, blendMode, !isOpaque, isLazyDecoded, isDataComplete()); | 64 context->preparePaintForDrawRectToRect(&paint, srcRect, destRect, compositeO
p, blendMode, !isOpaque, isLazyDecoded, isDataComplete()); |
65 // We want to filter it if we decided to do interpolation above, or if | 65 // We want to filter it if we decided to do interpolation above, or if |
66 // there is something interesting going on with the matrix (like a rotation)
. | 66 // there is something interesting going on with the matrix (like a rotation)
. |
67 // Note: for serialization, we will want to subset the bitmap first so we | 67 // Note: for serialization, we will want to subset the bitmap first so we |
68 // don't send extra pixels. | 68 // don't send extra pixels. |
69 context->drawBitmapRect(bitmap(), &srcRect, destRect, &paint); | 69 context->drawBitmapRect(bitmap(), &srcRect, destRect, &paint); |
70 | 70 |
71 if (isLazyDecoded) | 71 if (isLazyDecoded) |
72 PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID())
; | 72 PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID())
; |
73 context->didDrawRect(destRect, paint, &bitmap()); | |
74 } | 73 } |
75 | 74 |
76 static SkBitmap createBitmapWithSpace(const SkBitmap& bitmap, int spaceWidth, in
t spaceHeight) | 75 static SkBitmap createBitmapWithSpace(const SkBitmap& bitmap, int spaceWidth, in
t spaceHeight) |
77 { | 76 { |
78 SkImageInfo info = bitmap.info(); | 77 SkImageInfo info = bitmap.info(); |
79 info = SkImageInfo::Make(info.width() + spaceWidth, info.height() + spaceHei
ght, info.colorType(), kPremul_SkAlphaType); | 78 info = SkImageInfo::Make(info.width() + spaceWidth, info.height() + spaceHei
ght, info.colorType(), kPremul_SkAlphaType); |
80 | 79 |
81 SkBitmap result; | 80 SkBitmap result; |
82 result.allocPixels(info); | 81 result.allocPixels(info); |
83 result.eraseColor(SK_ColorTRANSPARENT); | 82 result.eraseColor(SK_ColorTRANSPARENT); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 paint.setColorFilter(context->colorFilter()); | 157 paint.setColorFilter(context->colorFilter()); |
159 paint.setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); | 158 paint.setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); |
160 | 159 |
161 if (isLazyDecoded) | 160 if (isLazyDecoded) |
162 PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID())
; | 161 PlatformInstrumentation::didDrawLazyPixelRef(bitmap().getGenerationID())
; |
163 | 162 |
164 context->drawRect(destRect, paint); | 163 context->drawRect(destRect, paint); |
165 } | 164 } |
166 | 165 |
167 } // namespace blink | 166 } // namespace blink |
OLD | NEW |