OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 SkCanvas canvas(skBitmap); | 97 SkCanvas canvas(skBitmap); |
98 canvas.concat(affineTransformToSkMatrix(orientation.transformFromDef
ault(sizeRespectingOrientation))); | 98 canvas.concat(affineTransformToSkMatrix(orientation.transformFromDef
ault(sizeRespectingOrientation))); |
99 canvas.drawBitmapRect(bitmap->bitmap(), 0, destRect); | 99 canvas.drawBitmapRect(bitmap->bitmap(), 0, destRect); |
100 | 100 |
101 return adoptPtr(new DragImage(skBitmap, deviceScaleFactor)); | 101 return adoptPtr(new DragImage(skBitmap, deviceScaleFactor)); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 SkBitmap skBitmap; | 105 SkBitmap skBitmap; |
106 if (!bitmap->bitmap().copyTo(&skBitmap, SkBitmap::kARGB_8888_Config)) | 106 if (!bitmap->bitmap().copyTo(&skBitmap, kPMColor_SkColorType)) |
107 return nullptr; | 107 return nullptr; |
108 return adoptPtr(new DragImage(skBitmap, deviceScaleFactor)); | 108 return adoptPtr(new DragImage(skBitmap, deviceScaleFactor)); |
109 } | 109 } |
110 | 110 |
111 static Font deriveDragLabelFont(int size, FontWeight fontWeight, const FontDescr
iption& systemFont) | 111 static Font deriveDragLabelFont(int size, FontWeight fontWeight, const FontDescr
iption& systemFont) |
112 { | 112 { |
113 FontDescription description = systemFont; | 113 FontDescription description = systemFont; |
114 description.setWeight(fontWeight); | 114 description.setWeight(fontWeight); |
115 description.setSpecifiedSize(size); | 115 description.setSpecifiedSize(size); |
116 description.setComputedSize(size); | 116 description.setComputedSize(size); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 *pixel = SkPreMultiplyARGB( | 265 *pixel = SkPreMultiplyARGB( |
266 SkColorGetA(*pixel) * fraction, | 266 SkColorGetA(*pixel) * fraction, |
267 SkColorGetR(*pixel), | 267 SkColorGetR(*pixel), |
268 SkColorGetG(*pixel), | 268 SkColorGetG(*pixel), |
269 SkColorGetB(*pixel)); | 269 SkColorGetB(*pixel)); |
270 } | 270 } |
271 } | 271 } |
272 } | 272 } |
273 | 273 |
274 } // namespace WebCore | 274 } // namespace WebCore |
OLD | NEW |