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

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

Issue 1478283002: Less type conversion for NinePieceImage painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « third_party/WebKit/Source/platform/graphics/GraphicsContext.h ('k') | no next file » | 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) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 * Copyright (C) 2013 Google 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 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 return static_cast<SkFilterQuality>(limitInterpolationQuality(this, resampli ng)); 832 return static_cast<SkFilterQuality>(limitInterpolationQuality(this, resampli ng));
833 } 833 }
834 834
835 void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, cons t IntPoint& srcPoint, const IntSize& tileSize, SkXfermode::Mode op, const IntSiz e& repeatSpacing) 835 void GraphicsContext::drawTiledImage(Image* image, const IntRect& destRect, cons t IntPoint& srcPoint, const IntSize& tileSize, SkXfermode::Mode op, const IntSiz e& repeatSpacing)
836 { 836 {
837 if (contextDisabled() || !image) 837 if (contextDisabled() || !image)
838 return; 838 return;
839 image->drawTiled(this, destRect, srcPoint, FloatSize(tileSize), op, repeatSp acing); 839 image->drawTiled(this, destRect, srcPoint, FloatSize(tileSize), op, repeatSp acing);
840 } 840 }
841 841
842 void GraphicsContext::drawTiledImage(Image* image, const IntRect& dest, const In tRect& srcRect, 842 void GraphicsContext::drawTiledImage(Image* image, const FloatRect& dest, const FloatRect& srcRect,
843 const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRu le, SkXfermode::Mode op) 843 const FloatSize& tileScaleFactor, Image::TileRule hRule, Image::TileRule vRu le, SkXfermode::Mode op)
844 { 844 {
845 if (contextDisabled() || !image) 845 if (contextDisabled() || !image)
846 return; 846 return;
847 847
848 if (hRule == Image::StretchTile && vRule == Image::StretchTile) { 848 if (hRule == Image::StretchTile && vRule == Image::StretchTile) {
849 // Just do a scale. 849 // Just do a scale.
850 drawImage(image, dest, srcRect, op); 850 drawImage(image, dest, srcRect, op);
851 return; 851 return;
852 } 852 }
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 static const SkPMColor colors[] = { 1344 static const SkPMColor colors[] = {
1345 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1345 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1346 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1346 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1347 }; 1347 };
1348 1348
1349 return colors[index]; 1349 return colors[index];
1350 } 1350 }
1351 #endif 1351 #endif
1352 1352
1353 } // namespace blink 1353 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698