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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Image.cpp

Issue 1949253004: Rounded background image fast path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 return image.release(); 264 return image.release();
265 } 265 }
266 266
267 bool Image::isTextureBacked() 267 bool Image::isTextureBacked()
268 { 268 {
269 RefPtr<SkImage> image = imageForCurrentFrame(); 269 RefPtr<SkImage> image = imageForCurrentFrame();
270 return image ? image->isTextureBacked() : false; 270 return image ? image->isTextureBacked() : false;
271 } 271 }
272 272
273 bool Image::applyShader(SkPaint& paint, const SkMatrix* localMatrix)
274 {
275 // Default shader impl: attempt to build a shader based on the current frame SkImage.
276 RefPtr<SkImage> image = imageForCurrentFrame();
277 if (!image)
278 return false;
279
280 paint.setShader(
281 image->makeShader(SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode , localMatrix));
282
283 return true;
284 }
285
273 } // namespace blink 286 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698