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" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 const CanvasImageSourceUnion&, | 180 const CanvasImageSourceUnion&, |
181 const String& repetition_type, | 181 const String& repetition_type, |
182 ExceptionState&); | 182 ExceptionState&); |
183 CanvasPattern* createPattern(ScriptState*, | 183 CanvasPattern* createPattern(ScriptState*, |
184 CanvasImageSource*, | 184 CanvasImageSource*, |
185 const String& repetition_type, | 185 const String& repetition_type, |
186 ExceptionState&); | 186 ExceptionState&); |
187 | 187 |
188 ImageData* createImageData(ImageData*, ExceptionState&) const; | 188 ImageData* createImageData(ImageData*, ExceptionState&) const; |
189 ImageData* createImageData(int width, int height, ExceptionState&) const; | 189 ImageData* createImageData(int width, int height, ExceptionState&) const; |
190 ImageData* getImageData(int sx, | 190 ImageData* getImageData(int sx, int sy, int sw, int sh, ExceptionState&); |
191 int sy, | |
192 int sw, | |
193 int sh, | |
194 ExceptionState&) const; | |
195 void putImageData(ImageData*, int dx, int dy, ExceptionState&); | 191 void putImageData(ImageData*, int dx, int dy, ExceptionState&); |
196 void putImageData(ImageData*, | 192 void putImageData(ImageData*, |
197 int dx, | 193 int dx, |
198 int dy, | 194 int dy, |
199 int dirty_x, | 195 int dirty_x, |
200 int dirty_y, | 196 int dirty_y, |
201 int dirty_width, | 197 int dirty_width, |
202 int dirty_height, | 198 int dirty_height, |
203 ExceptionState&); | 199 ExceptionState&); |
204 | 200 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 void TrackDrawCall(DrawCallType, | 331 void TrackDrawCall(DrawCallType, |
336 Path2D* path2d = nullptr, | 332 Path2D* path2d = nullptr, |
337 int width = 0, | 333 int width = 0, |
338 int height = 0); | 334 int height = 0); |
339 | 335 |
340 mutable UsageCounters usage_counters_; | 336 mutable UsageCounters usage_counters_; |
341 | 337 |
342 float EstimateRenderingCost( | 338 float EstimateRenderingCost( |
343 ExpensiveCanvasHeuristicParameters::RenderingModeCostIndex) const; | 339 ExpensiveCanvasHeuristicParameters::RenderingModeCostIndex) const; |
344 | 340 |
| 341 virtual void NeedsFinalizeFrame(){}; |
| 342 |
345 private: | 343 private: |
346 void RealizeSaves(); | 344 void RealizeSaves(); |
347 | 345 |
348 bool ShouldDrawImageAntialiased(const FloatRect& dest_rect) const; | 346 bool ShouldDrawImageAntialiased(const FloatRect& dest_rect) const; |
349 | 347 |
350 void DrawPathInternal(const Path&, | 348 void DrawPathInternal(const Path&, |
351 CanvasRenderingContext2DState::PaintType, | 349 CanvasRenderingContext2DState::PaintType, |
352 SkPath::FillType = SkPath::kWinding_FillType); | 350 SkPath::FillType = SkPath::kWinding_FillType); |
353 void DrawImageInternal(PaintCanvas*, | 351 void DrawImageInternal(PaintCanvas*, |
354 CanvasImageSource*, | 352 CanvasImageSource*, |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 foreground_flags.setBlendMode(SkBlendMode::kSrcOver); | 464 foreground_flags.setBlendMode(SkBlendMode::kSrcOver); |
467 c->setMatrix(ctm); | 465 c->setMatrix(ctm); |
468 draw_func(c, &foreground_flags); | 466 draw_func(c, &foreground_flags); |
469 c->restore(); | 467 c->restore(); |
470 c->setMatrix(ctm); | 468 c->setMatrix(ctm); |
471 } | 469 } |
472 | 470 |
473 } // namespace blink | 471 } // namespace blink |
474 | 472 |
475 #endif // BaseRenderingContext2D_h | 473 #endif // BaseRenderingContext2D_h |
OLD | NEW |