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

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

Issue 1209183003: Remove some dead code from GraphicsContext. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « 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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 } 897 }
898 898
899 void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, const FloatPoint& point, int h, const Color& backgroundColor, int from, int to) 899 void GraphicsContext::drawHighlightForText(const Font& font, const TextRun& run, const FloatPoint& point, int h, const Color& backgroundColor, int from, int to)
900 { 900 {
901 if (contextDisabled()) 901 if (contextDisabled())
902 return; 902 return;
903 903
904 fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor ); 904 fillRect(font.selectionRectForText(run, point, h, from, to), backgroundColor );
905 } 905 }
906 906
907 void GraphicsContext::drawImage(Image* image, const IntPoint& p, SkXfermode::Mod e op, RespectImageOrientationEnum shouldRespectImageOrientation)
908 {
909 if (!image)
910 return;
911 drawImage(image, FloatRect(IntRect(p, image->size())), FloatRect(FloatPoint( ), FloatSize(image->size())), op, shouldRespectImageOrientation);
912 }
913
914 void GraphicsContext::drawImage(Image* image, const IntRect& r, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOrientation) 907 void GraphicsContext::drawImage(Image* image, const IntRect& r, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOrientation)
915 { 908 {
916 if (!image) 909 if (!image)
917 return; 910 return;
918 drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size ())), op, shouldRespectImageOrientation); 911 drawImage(image, FloatRect(r), FloatRect(FloatPoint(), FloatSize(image->size ())), op, shouldRespectImageOrientation);
919 } 912 }
920 913
921 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const Float Rect& src, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOr ientation) 914 void GraphicsContext::drawImage(Image* image, const FloatRect& dest, const Float Rect& src, SkXfermode::Mode op, RespectImageOrientationEnum shouldRespectImageOr ientation)
922 { 915 {
923 if (contextDisabled() || !image) 916 if (contextDisabled() || !image)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 963
971 if (hRule == Image::StretchTile && vRule == Image::StretchTile) { 964 if (hRule == Image::StretchTile && vRule == Image::StretchTile) {
972 // Just do a scale. 965 // Just do a scale.
973 drawImage(image, dest, srcRect, op); 966 drawImage(image, dest, srcRect, op);
974 return; 967 return;
975 } 968 }
976 969
977 image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op); 970 image->drawTiled(this, dest, srcRect, tileScaleFactor, hRule, vRule, op);
978 } 971 }
979 972
980 void GraphicsContext::writePixels(const SkImageInfo& info, const void* pixels, s ize_t rowBytes, int x, int y)
981 {
982 if (contextDisabled())
983 return;
984 ASSERT(m_canvas);
985
986 m_canvas->writePixels(info, pixels, rowBytes, x, y);
987 }
988
989 void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint) 973 void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint)
990 { 974 {
991 if (contextDisabled()) 975 if (contextDisabled())
992 return; 976 return;
993 ASSERT(m_canvas); 977 ASSERT(m_canvas);
994 978
995 m_canvas->drawOval(oval, paint); 979 m_canvas->drawOval(oval, paint);
996 } 980 }
997 981
998 void GraphicsContext::drawPath(const SkPath& path, const SkPaint& paint) 982 void GraphicsContext::drawPath(const SkPath& path, const SkPaint& paint)
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 void GraphicsContext::setURLFragmentForRect(const String& destName, const IntRec t& rect) 1303 void GraphicsContext::setURLFragmentForRect(const String& destName, const IntRec t& rect)
1320 { 1304 {
1321 if (contextDisabled()) 1305 if (contextDisabled())
1322 return; 1306 return;
1323 ASSERT(m_canvas); 1307 ASSERT(m_canvas);
1324 1308
1325 SkAutoDataUnref skDestName(SkData::NewWithCString(destName.utf8().data())); 1309 SkAutoDataUnref skDestName(SkData::NewWithCString(destName.utf8().data()));
1326 SkAnnotateLinkToDestination(m_canvas, rect, skDestName.get()); 1310 SkAnnotateLinkToDestination(m_canvas, rect, skDestName.get());
1327 } 1311 }
1328 1312
1329 void GraphicsContext::addURLTargetAtPoint(const String& name, const IntPoint& po s)
1330 {
1331 if (contextDisabled())
1332 return;
1333 ASSERT(m_canvas);
1334
1335 SkAutoDataUnref nameData(SkData::NewWithCString(name.utf8().data()));
1336 SkAnnotateNamedDestination(m_canvas, SkPoint::Make(pos.x(), pos.y()), nameDa ta);
1337 }
1338
1339 AffineTransform GraphicsContext::getCTM() const 1313 AffineTransform GraphicsContext::getCTM() const
1340 { 1314 {
1341 ASSERT(!RuntimeEnabledFeatures::slimmingPaintEnabled()); 1315 ASSERT(!RuntimeEnabledFeatures::slimmingPaintEnabled());
1342 1316
1343 if (contextDisabled()) 1317 if (contextDisabled())
1344 return AffineTransform(); 1318 return AffineTransform();
1345 1319
1346 SkMatrix m = getTotalMatrix(); 1320 SkMatrix m = getTotalMatrix();
1347 return AffineTransform(SkScalarToDouble(m.getScaleX()), 1321 return AffineTransform(SkScalarToDouble(m.getScaleX()),
1348 SkScalarToDouble(m.getSkewY()), 1322 SkScalarToDouble(m.getSkewY()),
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 static const SkPMColor colors[] = { 1507 static const SkPMColor colors[] = {
1534 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red 1508 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red
1535 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray 1509 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray
1536 }; 1510 };
1537 1511
1538 return colors[index]; 1512 return colors[index];
1539 } 1513 }
1540 #endif 1514 #endif
1541 1515
1542 } // namespace blink 1516 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698