| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void setLineJoin(LineJoin join) { mutableState()->setLineJoin(join); } | 122 void setLineJoin(LineJoin join) { mutableState()->setLineJoin(join); } |
| 123 void setMiterLimit(float limit) { mutableState()->setMiterLimit(limit); } | 123 void setMiterLimit(float limit) { mutableState()->setMiterLimit(limit); } |
| 124 | 124 |
| 125 Color fillColor() const { return immutableState()->fillColor(); } | 125 Color fillColor() const { return immutableState()->fillColor(); } |
| 126 void setFillColor(const Color& color) { mutableState()->setFillColor(color);
} | 126 void setFillColor(const Color& color) { mutableState()->setFillColor(color);
} |
| 127 | 127 |
| 128 void setFillPattern(PassRefPtr<Pattern>, float alpha = 1); | 128 void setFillPattern(PassRefPtr<Pattern>, float alpha = 1); |
| 129 | 129 |
| 130 void setFillGradient(PassRefPtr<Gradient>, float alpha = 1); | 130 void setFillGradient(PassRefPtr<Gradient>, float alpha = 1); |
| 131 | 131 |
| 132 SkDrawLooper* drawLooper() const { return immutableState()->drawLooper(); } | |
| 133 | |
| 134 SkMatrix getTotalMatrix() const; | 132 SkMatrix getTotalMatrix() const; |
| 135 | 133 |
| 136 void setShouldAntialias(bool antialias) { mutableState()->setShouldAntialias
(antialias); } | 134 void setShouldAntialias(bool antialias) { mutableState()->setShouldAntialias
(antialias); } |
| 137 bool shouldAntialias() const { return immutableState()->shouldAntialias(); } | 135 bool shouldAntialias() const { return immutableState()->shouldAntialias(); } |
| 138 | 136 |
| 139 void setTextDrawingMode(TextDrawingModeFlags mode) { mutableState()->setText
DrawingMode(mode); } | 137 void setTextDrawingMode(TextDrawingModeFlags mode) { mutableState()->setText
DrawingMode(mode); } |
| 140 TextDrawingModeFlags textDrawingMode() const { return immutableState()->text
DrawingMode(); } | 138 TextDrawingModeFlags textDrawingMode() const { return immutableState()->text
DrawingMode(); } |
| 141 | 139 |
| 142 void setImageInterpolationQuality(InterpolationQuality quality) { mutableSta
te()->setInterpolationQuality(quality); } | 140 void setImageInterpolationQuality(InterpolationQuality quality) { mutableSta
te()->setInterpolationQuality(quality); } |
| 143 InterpolationQuality imageInterpolationQuality() const { return immutableSta
te()->interpolationQuality(); } | 141 InterpolationQuality imageInterpolationQuality() const { return immutableSta
te()->interpolationQuality(); } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 void fillDRRect(const FloatRoundedRect&, const FloatRoundedRect&, const Colo
r&); | 176 void fillDRRect(const FloatRoundedRect&, const FloatRoundedRect&, const Colo
r&); |
| 179 | 177 |
| 180 void clearRect(const FloatRect&); | 178 void clearRect(const FloatRect&); |
| 181 | 179 |
| 182 void strokeRect(const FloatRect&); | 180 void strokeRect(const FloatRect&); |
| 183 void strokeRect(const FloatRect&, float lineWidth); | 181 void strokeRect(const FloatRect&, float lineWidth); |
| 184 | 182 |
| 185 void drawPicture(const SkPicture*); | 183 void drawPicture(const SkPicture*); |
| 186 void compositePicture(SkPicture*, const FloatRect& dest, const FloatRect& sr
c, SkXfermode::Mode); | 184 void compositePicture(SkPicture*, const FloatRect& dest, const FloatRect& sr
c, SkXfermode::Mode); |
| 187 | 185 |
| 188 void drawImage(Image*, const IntPoint&, SkXfermode::Mode = SkXfermode::kSrcO
ver_Mode, RespectImageOrientationEnum = DoNotRespectImageOrientation); | |
| 189 void drawImage(Image*, const IntRect&, SkXfermode::Mode = SkXfermode::kSrcOv
er_Mode, RespectImageOrientationEnum = DoNotRespectImageOrientation); | 186 void drawImage(Image*, const IntRect&, SkXfermode::Mode = SkXfermode::kSrcOv
er_Mode, RespectImageOrientationEnum = DoNotRespectImageOrientation); |
| 190 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect,
SkXfermode::Mode = SkXfermode::kSrcOver_Mode, RespectImageOrientationEnum = DoNo
tRespectImageOrientation); | 187 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect,
SkXfermode::Mode = SkXfermode::kSrcOver_Mode, RespectImageOrientationEnum = DoNo
tRespectImageOrientation); |
| 191 | 188 |
| 192 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoin
t, const IntSize& tileSize, | 189 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoin
t, const IntSize& tileSize, |
| 193 SkXfermode::Mode = SkXfermode::kSrcOver_Mode, const IntSize& repeatSpaci
ng = IntSize()); | 190 SkXfermode::Mode = SkXfermode::kSrcOver_Mode, const IntSize& repeatSpaci
ng = IntSize()); |
| 194 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, | 191 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, |
| 195 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch
Tile, Image::TileRule vRule = Image::StretchTile, | 192 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch
Tile, Image::TileRule vRule = Image::StretchTile, |
| 196 SkXfermode::Mode = SkXfermode::kSrcOver_Mode); | 193 SkXfermode::Mode = SkXfermode::kSrcOver_Mode); |
| 197 | 194 |
| 198 // These methods write to the canvas. | 195 // These methods write to the canvas. |
| 199 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRou
ndedRect | 196 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRou
ndedRect |
| 200 void writePixels(const SkImageInfo&, const void* pixels, size_t rowBytes, in
t x, int y); | |
| 201 void drawOval(const SkRect&, const SkPaint&); | 197 void drawOval(const SkRect&, const SkPaint&); |
| 202 void drawPath(const SkPath&, const SkPaint&); | 198 void drawPath(const SkPath&, const SkPaint&); |
| 203 void drawRect(const SkRect&, const SkPaint&); | 199 void drawRect(const SkRect&, const SkPaint&); |
| 204 | 200 |
| 205 void clip(const IntRect& rect) { clipRect(rect); } | 201 void clip(const IntRect& rect) { clipRect(rect); } |
| 206 void clip(const FloatRect& rect) { clipRect(rect); } | 202 void clip(const FloatRect& rect) { clipRect(rect); } |
| 207 void clipRoundedRect(const FloatRoundedRect&, SkRegion::Op = SkRegion::kInte
rsect_Op); | 203 void clipRoundedRect(const FloatRoundedRect&, SkRegion::Op = SkRegion::kInte
rsect_Op); |
| 208 void clipOut(const IntRect& rect) { clipRect(rect, NotAntiAliased, SkRegion:
:kDifference_Op); } | 204 void clipOut(const IntRect& rect) { clipRect(rect, NotAntiAliased, SkRegion:
:kDifference_Op); } |
| 209 void clipOut(const FloatRect& rect) { clipRect(rect, NotAntiAliased, SkRegio
n::kDifference_Op); } | 205 void clipOut(const FloatRect& rect) { clipRect(rect, NotAntiAliased, SkRegio
n::kDifference_Op); } |
| 210 void clipOut(const Path&); | 206 void clipOut(const Path&); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 void scale(float x, float y); | 269 void scale(float x, float y); |
| 274 void rotate(float angleInRadians); | 270 void rotate(float angleInRadians); |
| 275 void translate(float x, float y); | 271 void translate(float x, float y); |
| 276 // ---------- End transformation methods ----------------- | 272 // ---------- End transformation methods ----------------- |
| 277 | 273 |
| 278 SkFilterQuality computeFilterQuality(Image*, const FloatRect& dest, const Fl
oatRect& src) const; | 274 SkFilterQuality computeFilterQuality(Image*, const FloatRect& dest, const Fl
oatRect& src) const; |
| 279 | 275 |
| 280 // URL drawing | 276 // URL drawing |
| 281 void setURLForRect(const KURL&, const IntRect&); | 277 void setURLForRect(const KURL&, const IntRect&); |
| 282 void setURLFragmentForRect(const String& name, const IntRect&); | 278 void setURLFragmentForRect(const String& name, const IntRect&); |
| 283 void addURLTargetAtPoint(const String& name, const IntPoint&); | |
| 284 | 279 |
| 285 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, floa
t strokeWidth, StrokeStyle); | 280 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, floa
t strokeWidth, StrokeStyle); |
| 286 | 281 |
| 287 static int focusRingOutsetExtent(int offset, int width) | 282 static int focusRingOutsetExtent(int offset, int width) |
| 288 { | 283 { |
| 289 return focusRingOutset(offset) + (focusRingWidth(width) + 1) / 2; | 284 return focusRingOutset(offset) + (focusRingWidth(width) + 1) / 2; |
| 290 } | 285 } |
| 291 | 286 |
| 292 // public decl needed for OwnPtr wrapper. | 287 // public decl needed for OwnPtr wrapper. |
| 293 class RecordingState; | 288 class RecordingState; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 395 |
| 401 float m_deviceScaleFactor; | 396 float m_deviceScaleFactor; |
| 402 | 397 |
| 403 unsigned m_printing : 1; | 398 unsigned m_printing : 1; |
| 404 unsigned m_hasMetaData : 1; | 399 unsigned m_hasMetaData : 1; |
| 405 }; | 400 }; |
| 406 | 401 |
| 407 } // namespace blink | 402 } // namespace blink |
| 408 | 403 |
| 409 #endif // GraphicsContext_h | 404 #endif // GraphicsContext_h |
| OLD | NEW |