| 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/CSSImageValueOrHTMLImageElementOrSVGImageElementOr
HTMLVideoElementOrHTMLCanvasElementOrImageBitmapOrOffscreenCanvas.h" | 8 #include "bindings/modules/v8/CSSImageValueOrHTMLImageElementOrSVGImageElementOr
HTMLVideoElementOrHTMLCanvasElementOrImageBitmapOrOffscreenCanvas.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" |
| 11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
| 12 #include "modules/canvas2d/CanvasGradient.h" | 12 #include "modules/canvas2d/CanvasGradient.h" |
| 13 #include "modules/canvas2d/CanvasPath.h" | 13 #include "modules/canvas2d/CanvasPath.h" |
| 14 #include "modules/canvas2d/CanvasRenderingContext2DState.h" | 14 #include "modules/canvas2d/CanvasRenderingContext2DState.h" |
| 15 #include "modules/canvas2d/CanvasStyle.h" | 15 #include "modules/canvas2d/CanvasStyle.h" |
| 16 #include "platform/graphics/CanvasHeuristicParameters.h" |
| 16 #include "platform/graphics/ColorBehavior.h" | 17 #include "platform/graphics/ColorBehavior.h" |
| 17 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" | |
| 18 #include "platform/graphics/paint/PaintCanvas.h" | 18 #include "platform/graphics/paint/PaintCanvas.h" |
| 19 #include "third_party/skia/include/effects/SkComposeImageFilter.h" | 19 #include "third_party/skia/include/effects/SkComposeImageFilter.h" |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 class CanvasImageSource; | 23 class CanvasImageSource; |
| 24 class Color; | 24 class Color; |
| 25 class Image; | 25 class Image; |
| 26 class ImageBuffer; | 26 class ImageBuffer; |
| 27 class Path2D; | 27 class Path2D; |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 }; | 345 }; |
| 346 | 346 |
| 347 void CheckOverdraw(const SkRect&, | 347 void CheckOverdraw(const SkRect&, |
| 348 const PaintFlags*, | 348 const PaintFlags*, |
| 349 CanvasRenderingContext2DState::ImageType, | 349 CanvasRenderingContext2DState::ImageType, |
| 350 DrawType); | 350 DrawType); |
| 351 | 351 |
| 352 HeapVector<Member<CanvasRenderingContext2DState>> state_stack_; | 352 HeapVector<Member<CanvasRenderingContext2DState>> state_stack_; |
| 353 AntiAliasingMode clip_antialiasing_; | 353 AntiAliasingMode clip_antialiasing_; |
| 354 | 354 |
| 355 void TrackDrawCall(DrawCallType, | |
| 356 Path2D* path2d = nullptr, | |
| 357 int width = 0, | |
| 358 int height = 0); | |
| 359 | |
| 360 mutable UsageCounters usage_counters_; | 355 mutable UsageCounters usage_counters_; |
| 361 | 356 |
| 362 float EstimateRenderingCost( | |
| 363 ExpensiveCanvasHeuristicParameters::RenderingModeCostIndex) const; | |
| 364 | |
| 365 virtual void NeedsFinalizeFrame(){}; | 357 virtual void NeedsFinalizeFrame(){}; |
| 366 | 358 |
| 367 private: | 359 private: |
| 368 void RealizeSaves(); | 360 void RealizeSaves(); |
| 369 | 361 |
| 370 bool ShouldDrawImageAntialiased(const FloatRect& dest_rect) const; | 362 bool ShouldDrawImageAntialiased(const FloatRect& dest_rect) const; |
| 371 | 363 |
| 372 void DrawPathInternal(const Path&, | 364 void DrawPathInternal(const Path&, |
| 373 CanvasRenderingContext2DState::PaintType, | 365 CanvasRenderingContext2DState::PaintType, |
| 374 SkPath::FillType = SkPath::kWinding_FillType); | 366 SkPath::FillType = SkPath::kWinding_FillType); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 foreground_flags.setBlendMode(SkBlendMode::kSrcOver); | 484 foreground_flags.setBlendMode(SkBlendMode::kSrcOver); |
| 493 c->setMatrix(ctm); | 485 c->setMatrix(ctm); |
| 494 draw_func(c, &foreground_flags); | 486 draw_func(c, &foreground_flags); |
| 495 c->restore(); | 487 c->restore(); |
| 496 c->setMatrix(ctm); | 488 c->setMatrix(ctm); |
| 497 } | 489 } |
| 498 | 490 |
| 499 } // namespace blink | 491 } // namespace blink |
| 500 | 492 |
| 501 #endif // BaseRenderingContext2D_h | 493 #endif // BaseRenderingContext2D_h |
| OLD | NEW |