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

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

Issue 1732563007: [NOT FOR COMMIT] Pass defaultObjectSize to get image size (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 if (contextDisabled()) 784 if (contextDisabled())
785 return; 785 return;
786 786
787 fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor ); 787 fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor );
788 } 788 }
789 789
790 void GraphicsContext::drawImage(Image* image, const IntRect& r, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOrientation) 790 void GraphicsContext::drawImage(Image* image, const IntRect& r, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOrientation)
791 { 791 {
792 if (!image) 792 if (!image)
793 return; 793 return;
794 drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size ())), op, shouldRespectImageOrientation); 794 drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->defa ultConcreteObjectSize())), op, shouldRespectImageOrientation);
795 } 795 }
796 796
797 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const Float Rect& src, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOr ientation) 797 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const Float Rect& src, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOr ientation)
798 { 798 {
799 if (contextDisabled() || !image) 799 if (contextDisabled() || !image)
800 return; 800 return;
801 801
802 SkPaint imagePaint = immutableState()->fillPaint(); 802 SkPaint imagePaint = immutableState()->fillPaint();
803 imagePaint.setXfermodeMode(op); 803 imagePaint.setXfermodeMode(op);
804 imagePaint.setColor(SK_ColorBLACK); 804 imagePaint.setColor(SK_ColorBLACK);
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 static const SkPMColor colors[] = { 1360 static const SkPMColor colors[] = {
1361 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1361 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1362 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1362 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1363 }; 1363 };
1364 1364
1365 return colors[index]; 1365 return colors[index];
1366 } 1366 }
1367 #endif 1367 #endif
1368 1368
1369 } // namespace blink 1369 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GeneratedImage.h ('k') | third_party/WebKit/Source/platform/graphics/Image.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698