Chromium Code Reviews| 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/modules/v8/CSSImageValueOrHTMLImageElementOrHTMLVideoElementO rHTMLCanvasElementOrImageBitmapOrOffscreenCanvas.h" | 8 #include "bindings/modules/v8/CSSImageValueOrHTMLImageElementOrHTMLVideoElementO rHTMLCanvasElementOrImageBitmapOrOffscreenCanvas.h" |
| 9 #include "bindings/modules/v8/StringOrCanvasGradientOrCanvasPattern.h" | 9 #include "bindings/modules/v8/StringOrCanvasGradientOrCanvasPattern.h" |
| 10 #include "core/html/ImageData.h" | 10 #include "core/html/ImageData.h" |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 448 } else { | 448 } else { |
| 449 ASSERT(isFullCanvasCompositeMode(state().globalComposite())); | 449 ASSERT(isFullCanvasCompositeMode(state().globalComposite())); |
| 450 c->saveLayer(nullptr, &compositePaint); | 450 c->saveLayer(nullptr, &compositePaint); |
| 451 shadowPaint.setBlendMode(SkBlendMode::kSrcOver); | 451 shadowPaint.setBlendMode(SkBlendMode::kSrcOver); |
| 452 c->setMatrix(ctm); | 452 c->setMatrix(ctm); |
| 453 drawFunc(c, &shadowPaint); | 453 drawFunc(c, &shadowPaint); |
| 454 } | 454 } |
| 455 c->restoreToCount(saveCount); | 455 c->restoreToCount(saveCount); |
| 456 } | 456 } |
| 457 | 457 |
| 458 compositePaint.setImageFilter(filter); | 458 compositePaint.setImageFilter(sk_ref_sp(filter)); |
|
Stephen White
2016/11/01 21:11:48
Rather than doing an explicit ref here, I think we
| |
| 459 c->saveLayer(nullptr, &compositePaint); | 459 c->saveLayer(nullptr, &compositePaint); |
| 460 SkPaint foregroundPaint = | 460 SkPaint foregroundPaint = |
| 461 *state().getPaint(paintType, DrawForegroundOnly, imageType); | 461 *state().getPaint(paintType, DrawForegroundOnly, imageType); |
| 462 foregroundPaint.setBlendMode(SkBlendMode::kSrcOver); | 462 foregroundPaint.setBlendMode(SkBlendMode::kSrcOver); |
| 463 c->setMatrix(ctm); | 463 c->setMatrix(ctm); |
| 464 drawFunc(c, &foregroundPaint); | 464 drawFunc(c, &foregroundPaint); |
| 465 c->restore(); | 465 c->restore(); |
| 466 c->setMatrix(ctm); | 466 c->setMatrix(ctm); |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace blink | 469 } // namespace blink |
| 470 | 470 |
| 471 #endif // BaseRenderingContext2D_h | 471 #endif // BaseRenderingContext2D_h |
| OLD | NEW |