| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BaseRenderingContext2D_h | 5 #ifndef BaseRenderingContext2D_h |
| 6 #define BaseRenderingContext2D_h | 6 #define BaseRenderingContext2D_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/UnionTypesCore.h" | 8 #include "bindings/core/v8/UnionTypesCore.h" |
| 9 #include "bindings/modules/v8/UnionTypesModules.h" | 9 #include "bindings/modules/v8/UnionTypesModules.h" |
| 10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 if (!state().isTransformInvertible()) | 208 if (!state().isTransformInvertible()) |
| 209 return false; | 209 return false; |
| 210 | 210 |
| 211 SkIRect clipBounds; | 211 SkIRect clipBounds; |
| 212 if (!drawingCanvas() || !drawingCanvas()->getClipDeviceBounds(&clipBounds)) | 212 if (!drawingCanvas() || !drawingCanvas()->getClipDeviceBounds(&clipBounds)) |
| 213 return false; | 213 return false; |
| 214 | 214 |
| 215 // If gradient size is zero, then paint nothing. | 215 // If gradient size is zero, then paint nothing. |
| 216 CanvasStyle* style = state().style(paintType); | 216 CanvasStyle* style = state().style(paintType); |
| 217 if (style) { | 217 if (style) { |
| 218 CanvasGradient* gradient = style->canvasGradient(); | 218 CanvasGradient* gradient = style->getCanvasGradient(); |
| 219 if (gradient && gradient->gradient()->isZeroSize()) | 219 if (gradient && gradient->getGradient()->isZeroSize()) |
| 220 return false; | 220 return false; |
| 221 } | 221 } |
| 222 | 222 |
| 223 if (isFullCanvasCompositeMode(state().globalComposite()) || stateHasFilter()
) { | 223 if (isFullCanvasCompositeMode(state().globalComposite()) || stateHasFilter()
) { |
| 224 compositedDraw(drawFunc, drawingCanvas(), paintType, imageType); | 224 compositedDraw(drawFunc, drawingCanvas(), paintType, imageType); |
| 225 didDraw(clipBounds); | 225 didDraw(clipBounds); |
| 226 } else if (state().globalComposite() == SkXfermode::kSrc_Mode) { | 226 } else if (state().globalComposite() == SkXfermode::kSrc_Mode) { |
| 227 clearCanvas(); // takes care of checkOverdraw() | 227 clearCanvas(); // takes care of checkOverdraw() |
| 228 const SkPaint* paint = state().getPaint(paintType, DrawForegroundOnly, i
mageType); | 228 const SkPaint* paint = state().getPaint(paintType, DrawForegroundOnly, i
mageType); |
| 229 drawFunc(drawingCanvas(), paint); | 229 drawFunc(drawingCanvas(), paint); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 foregroundPaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); | 282 foregroundPaint.setXfermodeMode(SkXfermode::kSrcOver_Mode); |
| 283 c->setMatrix(ctm); | 283 c->setMatrix(ctm); |
| 284 drawFunc(c, &foregroundPaint); | 284 drawFunc(c, &foregroundPaint); |
| 285 c->restore(); | 285 c->restore(); |
| 286 c->setMatrix(ctm); | 286 c->setMatrix(ctm); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace blink | 289 } // namespace blink |
| 290 | 290 |
| 291 #endif // BaseRenderingContext2D_h | 291 #endif // BaseRenderingContext2D_h |
| OLD | NEW |