| OLD | NEW |
| 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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 936 SkPaint paint(immutableState()->fillPaint()); | 936 SkPaint paint(immutableState()->fillPaint()); |
| 937 paint.setColor(effectiveStrokeColor()); | 937 paint.setColor(effectiveStrokeColor()); |
| 938 paint.setStyle(SkPaint::kStroke_Style); | 938 paint.setStyle(SkPaint::kStroke_Style); |
| 939 paint.setStrokeWidth(1); | 939 paint.setStrokeWidth(1); |
| 940 | 940 |
| 941 skRect.inset(0.5f, 0.5f); | 941 skRect.inset(0.5f, 0.5f); |
| 942 drawRect(skRect, paint); | 942 drawRect(skRect, paint); |
| 943 } | 943 } |
| 944 } | 944 } |
| 945 | 945 |
| 946 void GraphicsContext::drawText(const Font& font, const TextRunPaintInfo& runInfo
, const FloatPoint& point, const SkPaint& paint) |
| 947 { |
| 948 if (contextDisabled()) |
| 949 return; |
| 950 |
| 951 font.drawText(m_canvas, runInfo, point, m_deviceScaleFactor, paint); |
| 952 } |
| 953 |
| 946 template<typename DrawTextFunc> | 954 template<typename DrawTextFunc> |
| 947 void GraphicsContext::drawTextPasses(const DrawTextFunc& drawText) | 955 void GraphicsContext::drawTextPasses(const DrawTextFunc& drawText) |
| 948 { | 956 { |
| 949 TextDrawingModeFlags modeFlags = textDrawingMode(); | 957 TextDrawingModeFlags modeFlags = textDrawingMode(); |
| 950 | 958 |
| 951 if (modeFlags & TextModeFill) { | 959 if (modeFlags & TextModeFill) { |
| 952 drawText(immutableState()->fillPaint()); | 960 drawText(immutableState()->fillPaint()); |
| 953 } | 961 } |
| 954 | 962 |
| 955 if ((modeFlags & TextModeStroke) && strokeStyle() != NoStroke && strokeThick
ness() > 0) { | 963 if ((modeFlags & TextModeStroke) && strokeStyle() != NoStroke && strokeThick
ness() > 0) { |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1733 // being returned from computeInterpolationQuality. | 1741 // being returned from computeInterpolationQuality. |
| 1734 resampling = InterpolationLow; | 1742 resampling = InterpolationLow; |
| 1735 } | 1743 } |
| 1736 resampling = limitInterpolationQuality(this, resampling); | 1744 resampling = limitInterpolationQuality(this, resampling); |
| 1737 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); | 1745 paint->setFilterQuality(static_cast<SkFilterQuality>(resampling)); |
| 1738 | 1746 |
| 1739 return initialSaveCount; | 1747 return initialSaveCount; |
| 1740 } | 1748 } |
| 1741 | 1749 |
| 1742 } // namespace blink | 1750 } // namespace blink |
| OLD | NEW |