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

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

Issue 1447273003: Make the FloatSize constructor from an IntSize explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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) 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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 clipRoundedRect(rect); 465 clipRoundedRect(rect);
466 if (shadowSpread < 0) 466 if (shadowSpread < 0)
467 roundedHole.expandRadii(-shadowSpread); 467 roundedHole.expandRadii(-shadowSpread);
468 else 468 else
469 roundedHole.shrinkRadii(shadowSpread); 469 roundedHole.shrinkRadii(shadowSpread);
470 } else { 470 } else {
471 clip(rect.rect()); 471 clip(rect.rect());
472 } 472 }
473 473
474 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create(); 474 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create();
475 drawLooperBuilder->addShadow(shadowOffset, shadowBlur, shadowColor, 475 drawLooperBuilder->addShadow(FloatSize(shadowOffset), shadowBlur, shadowColo r,
476 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::ShadowIg noresAlpha); 476 DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::ShadowIg noresAlpha);
477 setDrawLooper(drawLooperBuilder.release()); 477 setDrawLooper(drawLooperBuilder.release());
478 fillRectWithRoundedHole(outerRect, roundedHole, fillColor); 478 fillRectWithRoundedHole(outerRect, roundedHole, fillColor);
479 } 479 }
480 480
481 void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2) 481 void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
482 { 482 {
483 if (contextDisabled()) 483 if (contextDisabled())
484 return; 484 return;
485 ASSERT(m_canvas); 485 ASSERT(m_canvas);
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 resampling = InterpolationLow; 829 resampling = InterpolationLow;
830 } 830 }
831 } 831 }
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, tileSize, op, repeatSpacing); 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 IntRect& dest, const In tRect& 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.
(...skipping 494 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

Powered by Google App Engine
This is Rietveld 408576698