| 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 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 | 1151 |
| 1152 m_canvas->scale(WebCoreFloatToSkScalar(x), WebCoreFloatToSkScalar(y)); | 1152 m_canvas->scale(WebCoreFloatToSkScalar(x), WebCoreFloatToSkScalar(y)); |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect) | 1155 void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect) |
| 1156 { | 1156 { |
| 1157 if (contextDisabled()) | 1157 if (contextDisabled()) |
| 1158 return; | 1158 return; |
| 1159 ASSERT(m_canvas); | 1159 ASSERT(m_canvas); |
| 1160 | 1160 |
| 1161 SkAutoDataUnref url(SkData::NewWithCString(link.getString().utf8().data())); | 1161 sk_sp<SkData> url(SkData::MakeWithCString(link.getString().utf8().data())); |
| 1162 SkAnnotateRectWithURL(m_canvas, destRect, url.get()); | 1162 SkAnnotateRectWithURL(m_canvas, destRect, url.get()); |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 void GraphicsContext::setURLFragmentForRect(const String& destName, const IntRec
t& rect) | 1165 void GraphicsContext::setURLFragmentForRect(const String& destName, const IntRec
t& rect) |
| 1166 { | 1166 { |
| 1167 if (contextDisabled()) | 1167 if (contextDisabled()) |
| 1168 return; | 1168 return; |
| 1169 ASSERT(m_canvas); | 1169 ASSERT(m_canvas); |
| 1170 | 1170 |
| 1171 SkAutoDataUnref skDestName(SkData::NewWithCString(destName.utf8().data())); | 1171 sk_sp<SkData> skDestName(SkData::MakeWithCString(destName.utf8().data())); |
| 1172 SkAnnotateLinkToDestination(m_canvas, rect, skDestName.get()); | 1172 SkAnnotateLinkToDestination(m_canvas, rect, skDestName.get()); |
| 1173 } | 1173 } |
| 1174 | 1174 |
| 1175 void GraphicsContext::setURLDestinationLocation(const String& name, const IntPoi
nt& location) | 1175 void GraphicsContext::setURLDestinationLocation(const String& name, const IntPoi
nt& location) |
| 1176 { | 1176 { |
| 1177 if (contextDisabled()) | 1177 if (contextDisabled()) |
| 1178 return; | 1178 return; |
| 1179 ASSERT(m_canvas); | 1179 ASSERT(m_canvas); |
| 1180 | 1180 |
| 1181 SkAutoDataUnref skName(SkData::NewWithCString(name.utf8().data())); | 1181 sk_sp<SkData> skName(SkData::MakeWithCString(name.utf8().data())); |
| 1182 SkAnnotateNamedDestination(m_canvas, SkPoint::Make(location.x(), location.y(
)), skName); | 1182 SkAnnotateNamedDestination(m_canvas, SkPoint::Make(location.x(), location.y(
)), skName.get()); |
| 1183 } | 1183 } |
| 1184 | 1184 |
| 1185 void GraphicsContext::concatCTM(const AffineTransform& affine) | 1185 void GraphicsContext::concatCTM(const AffineTransform& affine) |
| 1186 { | 1186 { |
| 1187 concat(affineTransformToSkMatrix(affine)); | 1187 concat(affineTransformToSkMatrix(affine)); |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
RoundedRect& roundedHoleRect, const Color& color) | 1190 void GraphicsContext::fillRectWithRoundedHole(const FloatRect& rect, const Float
RoundedRect& roundedHoleRect, const Color& color) |
| 1191 { | 1191 { |
| 1192 if (contextDisabled()) | 1192 if (contextDisabled()) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 static const SkPMColor colors[] = { | 1331 static const SkPMColor colors[] = { |
| 1332 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red | 1332 SkPreMultiplyARGB(0x60, 0xFF, 0x00, 0x00), // More transparent red |
| 1333 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray | 1333 SkPreMultiplyARGB(0x60, 0xC0, 0xC0, 0xC0) // More transparent gray |
| 1334 }; | 1334 }; |
| 1335 | 1335 |
| 1336 return colors[index]; | 1336 return colors[index]; |
| 1337 } | 1337 } |
| 1338 #endif | 1338 #endif |
| 1339 | 1339 |
| 1340 } // namespace blink | 1340 } // namespace blink |
| OLD | NEW |