| 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 , m_paintStateIndex(0) | 118 , m_paintStateIndex(0) |
| 119 , m_pendingCanvasSave(false) | 119 , m_pendingCanvasSave(false) |
| 120 , m_annotationMode(0) | 120 , m_annotationMode(0) |
| 121 #if ENABLE(ASSERT) | 121 #if ENABLE(ASSERT) |
| 122 , m_annotationCount(0) | 122 , m_annotationCount(0) |
| 123 , m_layerCount(0) | 123 , m_layerCount(0) |
| 124 , m_disableDestructionChecks(false) | 124 , m_disableDestructionChecks(false) |
| 125 #endif | 125 #endif |
| 126 , m_disabledState(disableContextOrPainting) | 126 , m_disabledState(disableContextOrPainting) |
| 127 , m_deviceScaleFactor(1.0f) | 127 , m_deviceScaleFactor(1.0f) |
| 128 , m_trackOpaqueRegion(false) | 128 , m_regionTrackingMode(RegionTrackingDisabled) |
| 129 , m_trackTextRegion(false) | 129 , m_trackTextRegion(false) |
| 130 , m_updatingControlTints(false) | 130 , m_updatingControlTints(false) |
| 131 , m_accelerated(false) | 131 , m_accelerated(false) |
| 132 , m_isCertainlyOpaque(true) | 132 , m_isCertainlyOpaque(true) |
| 133 , m_printing(false) | 133 , m_printing(false) |
| 134 , m_antialiasHairlineImages(false) | 134 , m_antialiasHairlineImages(false) |
| 135 { | 135 { |
| 136 if (!canvas) | 136 if (!canvas) |
| 137 m_disabledState |= PaintingDisabled; | 137 m_disabledState |= PaintingDisabled; |
| 138 | 138 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 153 ASSERT(m_recordingStateStack.isEmpty()); | 153 ASSERT(m_recordingStateStack.isEmpty()); |
| 154 ASSERT(m_canvasStateStack.isEmpty()); | 154 ASSERT(m_canvasStateStack.isEmpty()); |
| 155 } | 155 } |
| 156 #endif | 156 #endif |
| 157 } | 157 } |
| 158 | 158 |
| 159 void GraphicsContext::resetCanvas(SkCanvas* canvas) | 159 void GraphicsContext::resetCanvas(SkCanvas* canvas) |
| 160 { | 160 { |
| 161 ASSERT(canvas); | 161 ASSERT(canvas); |
| 162 m_canvas = canvas; | 162 m_canvas = canvas; |
| 163 m_opaqueRegion.reset(); | 163 m_trackedRegion.reset(); |
| 164 } |
| 165 |
| 166 void GraphicsContext::setRegionTrackingMode(RegionTrackingMode mode) |
| 167 { |
| 168 m_regionTrackingMode = mode; |
| 169 if (mode == RegionTrackingOpaque) |
| 170 m_trackedRegion.setTrackedRegionType(RegionTracker::Opaque); |
| 171 else if (mode == RegionTrackingOverwrite) |
| 172 m_trackedRegion.setTrackedRegionType(RegionTracker::Overwrite); |
| 164 } | 173 } |
| 165 | 174 |
| 166 void GraphicsContext::save() | 175 void GraphicsContext::save() |
| 167 { | 176 { |
| 168 if (contextDisabled()) | 177 if (contextDisabled()) |
| 169 return; | 178 return; |
| 170 | 179 |
| 171 m_paintState->incrementSaveCount(); | 180 m_paintState->incrementSaveCount(); |
| 172 | 181 |
| 173 m_canvasStateStack.append(CanvasSaveState(m_pendingCanvasSave, m_canvas->get
SaveCount())); | 182 m_canvasStateStack.append(CanvasSaveState(m_pendingCanvasSave, m_canvas->get
SaveCount())); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 198 } | 207 } |
| 199 | 208 |
| 200 void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint) | 209 void GraphicsContext::saveLayer(const SkRect* bounds, const SkPaint* paint) |
| 201 { | 210 { |
| 202 if (contextDisabled()) | 211 if (contextDisabled()) |
| 203 return; | 212 return; |
| 204 | 213 |
| 205 realizeCanvasSave(); | 214 realizeCanvasSave(); |
| 206 | 215 |
| 207 m_canvas->saveLayer(bounds, paint); | 216 m_canvas->saveLayer(bounds, paint); |
| 208 if (m_trackOpaqueRegion) | 217 if (regionTrackingEnabled()) |
| 209 m_opaqueRegion.pushCanvasLayer(paint); | 218 m_trackedRegion.pushCanvasLayer(paint); |
| 210 } | 219 } |
| 211 | 220 |
| 212 void GraphicsContext::restoreLayer() | 221 void GraphicsContext::restoreLayer() |
| 213 { | 222 { |
| 214 if (contextDisabled()) | 223 if (contextDisabled()) |
| 215 return; | 224 return; |
| 216 | 225 |
| 217 m_canvas->restore(); | 226 m_canvas->restore(); |
| 218 if (m_trackOpaqueRegion) | 227 if (regionTrackingEnabled()) |
| 219 m_opaqueRegion.popCanvasLayer(this); | 228 m_trackedRegion.popCanvasLayer(this); |
| 220 } | 229 } |
| 221 | 230 |
| 222 void GraphicsContext::beginAnnotation(const AnnotationList& annotations) | 231 void GraphicsContext::beginAnnotation(const AnnotationList& annotations) |
| 223 { | 232 { |
| 224 if (contextDisabled()) | 233 if (contextDisabled()) |
| 225 return; | 234 return; |
| 226 | 235 |
| 227 canvas()->beginCommentGroup("GraphicsContextAnnotation"); | 236 canvas()->beginCommentGroup("GraphicsContextAnnotation"); |
| 228 | 237 |
| 229 AnnotationList::const_iterator end = annotations.end(); | 238 AnnotationList::const_iterator end = annotations.end(); |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 fillPaint.setColor(paint.getColor()); | 726 fillPaint.setColor(paint.getColor()); |
| 718 drawRect(r1, fillPaint); | 727 drawRect(r1, fillPaint); |
| 719 drawRect(r2, fillPaint); | 728 drawRect(r2, fillPaint); |
| 720 } | 729 } |
| 721 | 730 |
| 722 adjustLineToPixelBoundaries(p1, p2, width, penStyle); | 731 adjustLineToPixelBoundaries(p1, p2, width, penStyle); |
| 723 SkPoint pts[2] = { p1.data(), p2.data() }; | 732 SkPoint pts[2] = { p1.data(), p2.data() }; |
| 724 | 733 |
| 725 m_canvas->drawPoints(SkCanvas::kLines_PointMode, 2, pts, paint); | 734 m_canvas->drawPoints(SkCanvas::kLines_PointMode, 2, pts, paint); |
| 726 | 735 |
| 727 if (m_trackOpaqueRegion) | 736 if (regionTrackingEnabled()) |
| 728 m_opaqueRegion.didDrawPoints(this, SkCanvas::kLines_PointMode, 2, pts, p
aint); | 737 m_trackedRegion.didDrawPoints(this, SkCanvas::kLines_PointMode, 2, pts,
paint); |
| 729 } | 738 } |
| 730 | 739 |
| 731 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float widt
h, DocumentMarkerLineStyle style) | 740 void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& pt, float widt
h, DocumentMarkerLineStyle style) |
| 732 { | 741 { |
| 733 if (contextDisabled()) | 742 if (contextDisabled()) |
| 734 return; | 743 return; |
| 735 | 744 |
| 736 // Use 2x resources for a device scale factor of 1.5 or above. | 745 // Use 2x resources for a device scale factor of 1.5 or above. |
| 737 int deviceScaleFactor = m_deviceScaleFactor > 1.5f ? 2 : 1; | 746 int deviceScaleFactor = m_deviceScaleFactor > 1.5f ? 2 : 1; |
| 738 | 747 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 restoreLayer(); | 1076 restoreLayer(); |
| 1068 } | 1077 } |
| 1069 | 1078 |
| 1070 void GraphicsContext::writePixels(const SkImageInfo& info, const void* pixels, s
ize_t rowBytes, int x, int y) | 1079 void GraphicsContext::writePixels(const SkImageInfo& info, const void* pixels, s
ize_t rowBytes, int x, int y) |
| 1071 { | 1080 { |
| 1072 if (contextDisabled()) | 1081 if (contextDisabled()) |
| 1073 return; | 1082 return; |
| 1074 | 1083 |
| 1075 m_canvas->writePixels(info, pixels, rowBytes, x, y); | 1084 m_canvas->writePixels(info, pixels, rowBytes, x, y); |
| 1076 | 1085 |
| 1077 if (m_trackOpaqueRegion) { | 1086 if (regionTrackingEnabled()) { |
| 1078 SkRect rect = SkRect::MakeXYWH(x, y, info.width(), info.height()); | 1087 SkRect rect = SkRect::MakeXYWH(x, y, info.width(), info.height()); |
| 1079 SkPaint paint; | 1088 SkPaint paint; |
| 1080 | 1089 |
| 1081 paint.setXfermodeMode(SkXfermode::kSrc_Mode); | 1090 paint.setXfermodeMode(SkXfermode::kSrc_Mode); |
| 1082 if (kOpaque_SkAlphaType != info.alphaType()) | 1091 if (kOpaque_SkAlphaType != info.alphaType()) |
| 1083 paint.setAlpha(0x80); // signal to m_opaqueRegion that we are not fu
lly opaque | 1092 paint.setAlpha(0x80); // signal to m_trackedRegion that we are not f
ully opaque |
| 1084 | 1093 |
| 1085 m_opaqueRegion.didDrawRect(this, rect, paint, 0); | 1094 m_trackedRegion.didDrawRect(this, rect, paint, 0); |
| 1086 // more efficient would be to call markRectAsOpaque or MarkRectAsNonOpaq
ue directly, | 1095 // more efficient would be to call markRectAsOpaque or MarkRectAsNonOpaq
ue directly, |
| 1087 // rather than cons-ing up a paint with an xfermode and alpha | 1096 // rather than cons-ing up a paint with an xfermode and alpha |
| 1088 } | 1097 } |
| 1089 } | 1098 } |
| 1090 | 1099 |
| 1091 void GraphicsContext::writePixels(const SkBitmap& bitmap, int x, int y) | 1100 void GraphicsContext::writePixels(const SkBitmap& bitmap, int x, int y) |
| 1092 { | 1101 { |
| 1093 if (contextDisabled()) | 1102 if (contextDisabled()) |
| 1094 return; | 1103 return; |
| 1095 | 1104 |
| 1096 if (!bitmap.getTexture()) { | 1105 if (!bitmap.getTexture()) { |
| 1097 SkAutoLockPixels alp(bitmap); | 1106 SkAutoLockPixels alp(bitmap); |
| 1098 if (bitmap.getPixels()) | 1107 if (bitmap.getPixels()) |
| 1099 writePixels(bitmap.info(), bitmap.getPixels(), bitmap.rowBytes(), x,
y); | 1108 writePixels(bitmap.info(), bitmap.getPixels(), bitmap.rowBytes(), x,
y); |
| 1100 } | 1109 } |
| 1101 } | 1110 } |
| 1102 | 1111 |
| 1103 void GraphicsContext::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar
top, const SkPaint* paint) | 1112 void GraphicsContext::drawBitmap(const SkBitmap& bitmap, SkScalar left, SkScalar
top, const SkPaint* paint) |
| 1104 { | 1113 { |
| 1105 if (contextDisabled()) | 1114 if (contextDisabled()) |
| 1106 return; | 1115 return; |
| 1107 | 1116 |
| 1108 m_canvas->drawBitmap(bitmap, left, top, paint); | 1117 m_canvas->drawBitmap(bitmap, left, top, paint); |
| 1109 | 1118 |
| 1110 if (m_trackOpaqueRegion) { | 1119 if (regionTrackingEnabled()) { |
| 1111 SkRect rect = SkRect::MakeXYWH(left, top, bitmap.width(), bitmap.height(
)); | 1120 SkRect rect = SkRect::MakeXYWH(left, top, bitmap.width(), bitmap.height(
)); |
| 1112 m_opaqueRegion.didDrawRect(this, rect, *paint, &bitmap); | 1121 m_trackedRegion.didDrawRect(this, rect, *paint, &bitmap); |
| 1113 } | 1122 } |
| 1114 } | 1123 } |
| 1115 | 1124 |
| 1116 void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, | 1125 void GraphicsContext::drawBitmapRect(const SkBitmap& bitmap, const SkRect* src, |
| 1117 const SkRect& dst, const SkPaint* paint) | 1126 const SkRect& dst, const SkPaint* paint) |
| 1118 { | 1127 { |
| 1119 if (contextDisabled()) | 1128 if (contextDisabled()) |
| 1120 return; | 1129 return; |
| 1121 | 1130 |
| 1122 SkCanvas::DrawBitmapRectFlags flags = | 1131 SkCanvas::DrawBitmapRectFlags flags = |
| 1123 immutableState()->shouldClampToSourceRect() ? SkCanvas::kNone_DrawBitmap
RectFlag : SkCanvas::kBleed_DrawBitmapRectFlag; | 1132 immutableState()->shouldClampToSourceRect() ? SkCanvas::kNone_DrawBitmap
RectFlag : SkCanvas::kBleed_DrawBitmapRectFlag; |
| 1124 | 1133 |
| 1125 m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags); | 1134 m_canvas->drawBitmapRectToRect(bitmap, src, dst, paint, flags); |
| 1126 | 1135 |
| 1127 if (m_trackOpaqueRegion) | 1136 if (regionTrackingEnabled()) |
| 1128 m_opaqueRegion.didDrawRect(this, dst, *paint, &bitmap); | 1137 m_trackedRegion.didDrawRect(this, dst, *paint, &bitmap); |
| 1129 } | 1138 } |
| 1130 | 1139 |
| 1131 void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint) | 1140 void GraphicsContext::drawOval(const SkRect& oval, const SkPaint& paint) |
| 1132 { | 1141 { |
| 1133 if (contextDisabled()) | 1142 if (contextDisabled()) |
| 1134 return; | 1143 return; |
| 1135 | 1144 |
| 1136 m_canvas->drawOval(oval, paint); | 1145 m_canvas->drawOval(oval, paint); |
| 1137 | 1146 |
| 1138 if (m_trackOpaqueRegion) | 1147 if (regionTrackingEnabled()) |
| 1139 m_opaqueRegion.didDrawBounded(this, oval, paint); | 1148 m_trackedRegion.didDrawBounded(this, oval, paint); |
| 1140 } | 1149 } |
| 1141 | 1150 |
| 1142 void GraphicsContext::drawPath(const SkPath& path, const SkPaint& paint) | 1151 void GraphicsContext::drawPath(const SkPath& path, const SkPaint& paint) |
| 1143 { | 1152 { |
| 1144 if (contextDisabled()) | 1153 if (contextDisabled()) |
| 1145 return; | 1154 return; |
| 1146 | 1155 |
| 1147 m_canvas->drawPath(path, paint); | 1156 m_canvas->drawPath(path, paint); |
| 1148 | 1157 |
| 1149 if (m_trackOpaqueRegion) | 1158 if (regionTrackingEnabled()) |
| 1150 m_opaqueRegion.didDrawPath(this, path, paint); | 1159 m_trackedRegion.didDrawPath(this, path, paint); |
| 1151 } | 1160 } |
| 1152 | 1161 |
| 1153 void GraphicsContext::drawRect(const SkRect& rect, const SkPaint& paint) | 1162 void GraphicsContext::drawRect(const SkRect& rect, const SkPaint& paint) |
| 1154 { | 1163 { |
| 1155 if (contextDisabled()) | 1164 if (contextDisabled()) |
| 1156 return; | 1165 return; |
| 1157 | 1166 |
| 1158 m_canvas->drawRect(rect, paint); | 1167 m_canvas->drawRect(rect, paint); |
| 1159 | 1168 |
| 1160 if (m_trackOpaqueRegion) | 1169 if (regionTrackingEnabled()) |
| 1161 m_opaqueRegion.didDrawRect(this, rect, paint, 0); | 1170 m_trackedRegion.didDrawRect(this, rect, paint, 0); |
| 1162 } | 1171 } |
| 1163 | 1172 |
| 1164 void GraphicsContext::didDrawRect(const SkRect& rect, const SkPaint& paint, cons
t SkBitmap* bitmap) | 1173 void GraphicsContext::didDrawRect(const SkRect& rect, const SkPaint& paint, cons
t SkBitmap* bitmap) |
| 1165 { | 1174 { |
| 1166 if (contextDisabled()) | 1175 if (contextDisabled()) |
| 1167 return; | 1176 return; |
| 1168 | 1177 |
| 1169 if (m_trackOpaqueRegion) | 1178 if (regionTrackingEnabled()) |
| 1170 m_opaqueRegion.didDrawRect(this, rect, paint, bitmap); | 1179 m_trackedRegion.didDrawRect(this, rect, paint, bitmap); |
| 1171 } | 1180 } |
| 1172 | 1181 |
| 1173 void GraphicsContext::drawPosText(const void* text, size_t byteLength, | 1182 void GraphicsContext::drawPosText(const void* text, size_t byteLength, |
| 1174 const SkPoint pos[], const SkRect& textRect, const SkPaint& paint) | 1183 const SkPoint pos[], const SkRect& textRect, const SkPaint& paint) |
| 1175 { | 1184 { |
| 1176 if (contextDisabled()) | 1185 if (contextDisabled()) |
| 1177 return; | 1186 return; |
| 1178 | 1187 |
| 1179 m_canvas->drawPosText(text, byteLength, pos, paint); | 1188 m_canvas->drawPosText(text, byteLength, pos, paint); |
| 1180 didDrawTextInRect(textRect); | 1189 didDrawTextInRect(textRect); |
| 1181 | 1190 |
| 1182 // FIXME: compute bounds for positioned text. | 1191 // FIXME: compute bounds for positioned text. |
| 1183 if (m_trackOpaqueRegion) | 1192 if (regionTrackingEnabled()) |
| 1184 m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStr
oke); | 1193 m_trackedRegion.didDrawUnbounded(this, paint, RegionTracker::FillOrStrok
e); |
| 1185 } | 1194 } |
| 1186 | 1195 |
| 1187 void GraphicsContext::drawPosTextH(const void* text, size_t byteLength, | 1196 void GraphicsContext::drawPosTextH(const void* text, size_t byteLength, |
| 1188 const SkScalar xpos[], SkScalar constY, const SkRect& textRect, const SkPain
t& paint) | 1197 const SkScalar xpos[], SkScalar constY, const SkRect& textRect, const SkPain
t& paint) |
| 1189 { | 1198 { |
| 1190 if (contextDisabled()) | 1199 if (contextDisabled()) |
| 1191 return; | 1200 return; |
| 1192 | 1201 |
| 1193 m_canvas->drawPosTextH(text, byteLength, xpos, constY, paint); | 1202 m_canvas->drawPosTextH(text, byteLength, xpos, constY, paint); |
| 1194 didDrawTextInRect(textRect); | 1203 didDrawTextInRect(textRect); |
| 1195 | 1204 |
| 1196 // FIXME: compute bounds for positioned text. | 1205 // FIXME: compute bounds for positioned text. |
| 1197 if (m_trackOpaqueRegion) | 1206 if (regionTrackingEnabled()) |
| 1198 m_opaqueRegion.didDrawUnbounded(this, paint, OpaqueRegionSkia::FillOrStr
oke); | 1207 m_trackedRegion.didDrawUnbounded(this, paint, RegionTracker::FillOrStrok
e); |
| 1199 } | 1208 } |
| 1200 | 1209 |
| 1201 void GraphicsContext::fillPath(const Path& pathToFill) | 1210 void GraphicsContext::fillPath(const Path& pathToFill) |
| 1202 { | 1211 { |
| 1203 if (contextDisabled() || pathToFill.isEmpty()) | 1212 if (contextDisabled() || pathToFill.isEmpty()) |
| 1204 return; | 1213 return; |
| 1205 | 1214 |
| 1206 // Use const_cast and temporarily modify the fill type instead of copying th
e path. | 1215 // Use const_cast and temporarily modify the fill type instead of copying th
e path. |
| 1207 SkPath& path = const_cast<SkPath&>(pathToFill.skPath()); | 1216 SkPath& path = const_cast<SkPath&>(pathToFill.skPath()); |
| 1208 SkPath::FillType previousFillType = path.getFillType(); | 1217 SkPath::FillType previousFillType = path.getFillType(); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1250 SkRRect rrOuter; | 1259 SkRRect rrOuter; |
| 1251 SkRRect rrInner; | 1260 SkRRect rrInner; |
| 1252 rrOuter.setRectRadii(outer, outerRadii); | 1261 rrOuter.setRectRadii(outer, outerRadii); |
| 1253 rrInner.setRectRadii(inner, innerRadii); | 1262 rrInner.setRectRadii(inner, innerRadii); |
| 1254 | 1263 |
| 1255 SkPaint paint(immutableState()->fillPaint()); | 1264 SkPaint paint(immutableState()->fillPaint()); |
| 1256 paint.setColor(color.rgb()); | 1265 paint.setColor(color.rgb()); |
| 1257 | 1266 |
| 1258 m_canvas->drawDRRect(rrOuter, rrInner, paint); | 1267 m_canvas->drawDRRect(rrOuter, rrInner, paint); |
| 1259 | 1268 |
| 1260 if (m_trackOpaqueRegion) | 1269 if (regionTrackingEnabled()) |
| 1261 m_opaqueRegion.didDrawBounded(this, rrOuter.getBounds(), paint); | 1270 m_trackedRegion.didDrawBounded(this, rrOuter.getBounds(), paint); |
| 1262 } | 1271 } |
| 1263 | 1272 |
| 1264 void GraphicsContext::fillBetweenRoundedRects(const RoundedRect& outer, const Ro
undedRect& inner, const Color& color) | 1273 void GraphicsContext::fillBetweenRoundedRects(const RoundedRect& outer, const Ro
undedRect& inner, const Color& color) |
| 1265 { | 1274 { |
| 1266 fillBetweenRoundedRects(outer.rect(), outer.radii().topLeft(), outer.radii()
.topRight(), outer.radii().bottomLeft(), outer.radii().bottomRight(), | 1275 fillBetweenRoundedRects(outer.rect(), outer.radii().topLeft(), outer.radii()
.topRight(), outer.radii().bottomLeft(), outer.radii().bottomRight(), |
| 1267 inner.rect(), inner.radii().topLeft(), inner.radii().topRight(), inner.r
adii().bottomLeft(), inner.radii().bottomRight(), color); | 1276 inner.rect(), inner.radii().topLeft(), inner.radii().topRight(), inner.r
adii().bottomLeft(), inner.radii().bottomRight(), color); |
| 1268 } | 1277 } |
| 1269 | 1278 |
| 1270 void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLef
t, const IntSize& topRight, | 1279 void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLef
t, const IntSize& topRight, |
| 1271 const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color) | 1280 const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1288 setRadii(radii, topLeft, topRight, bottomRight, bottomLeft); | 1297 setRadii(radii, topLeft, topRight, bottomRight, bottomLeft); |
| 1289 | 1298 |
| 1290 SkRRect rr; | 1299 SkRRect rr; |
| 1291 rr.setRectRadii(rect, radii); | 1300 rr.setRectRadii(rect, radii); |
| 1292 | 1301 |
| 1293 SkPaint paint(immutableState()->fillPaint()); | 1302 SkPaint paint(immutableState()->fillPaint()); |
| 1294 paint.setColor(color.rgb()); | 1303 paint.setColor(color.rgb()); |
| 1295 | 1304 |
| 1296 m_canvas->drawRRect(rr, paint); | 1305 m_canvas->drawRRect(rr, paint); |
| 1297 | 1306 |
| 1298 if (m_trackOpaqueRegion) | 1307 if (regionTrackingEnabled()) |
| 1299 m_opaqueRegion.didDrawBounded(this, rr.getBounds(), paint); | 1308 m_trackedRegion.didDrawBounded(this, rr.getBounds(), paint); |
| 1300 } | 1309 } |
| 1301 | 1310 |
| 1302 void GraphicsContext::fillEllipse(const FloatRect& ellipse) | 1311 void GraphicsContext::fillEllipse(const FloatRect& ellipse) |
| 1303 { | 1312 { |
| 1304 if (contextDisabled()) | 1313 if (contextDisabled()) |
| 1305 return; | 1314 return; |
| 1306 | 1315 |
| 1307 SkRect rect = ellipse; | 1316 SkRect rect = ellipse; |
| 1308 drawOval(rect, immutableState()->fillPaint()); | 1317 drawOval(rect, immutableState()->fillPaint()); |
| 1309 } | 1318 } |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag | 1903 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag |
| 1895 // being set to true). We need to decide if we respect InterpolationNone | 1904 // being set to true). We need to decide if we respect InterpolationNone |
| 1896 // being returned from computeInterpolationQuality. | 1905 // being returned from computeInterpolationQuality. |
| 1897 resampling = InterpolationLow; | 1906 resampling = InterpolationLow; |
| 1898 } | 1907 } |
| 1899 resampling = limitInterpolationQuality(this, resampling); | 1908 resampling = limitInterpolationQuality(this, resampling); |
| 1900 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); | 1909 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); |
| 1901 } | 1910 } |
| 1902 | 1911 |
| 1903 } | 1912 } |
| OLD | NEW |