Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: Source/platform/DragImage.cpp

Issue 183833011: SkBitmap::Config is deprecated, switch to using SkColorType (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/platform/graphics/ImageFrameGenerator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/ImageFrameGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698