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 #include "modules/canvas2d/BaseRenderingContext2D.h" | 5 #include "modules/canvas2d/BaseRenderingContext2D.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionMessages.h" | 7 #include "bindings/core/v8/ExceptionMessages.h" |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "core/css/cssom/CSSURLImageValue.h" | 9 #include "core/css/cssom/CSSURLImageValue.h" |
10 #include "core/css/parser/CSSParser.h" | 10 #include "core/css/parser/CSSParser.h" |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1468 return nullptr; | 1468 return nullptr; |
1469 default: | 1469 default: |
1470 NOTREACHED(); | 1470 NOTREACHED(); |
1471 return nullptr; | 1471 return nullptr; |
1472 } | 1472 } |
1473 DCHECK(image_for_rendering); | 1473 DCHECK(image_for_rendering); |
1474 | 1474 |
1475 bool origin_clean = | 1475 bool origin_clean = |
1476 !WouldTaintOrigin(image_source, ExecutionContext::From(script_state)); | 1476 !WouldTaintOrigin(image_source, ExecutionContext::From(script_state)); |
1477 | 1477 |
1478 return CanvasPattern::Create(image_for_rendering.Release(), repeat_mode, | 1478 return CanvasPattern::Create(std::move(image_for_rendering), repeat_mode, |
1479 origin_clean); | 1479 origin_clean); |
1480 } | 1480 } |
1481 | 1481 |
1482 bool BaseRenderingContext2D::ComputeDirtyRect(const FloatRect& local_rect, | 1482 bool BaseRenderingContext2D::ComputeDirtyRect(const FloatRect& local_rect, |
1483 SkIRect* dirty_rect) { | 1483 SkIRect* dirty_rect) { |
1484 SkIRect clip_bounds; | 1484 SkIRect clip_bounds; |
1485 if (!DrawingCanvas()->getDeviceClipBounds(&clip_bounds)) | 1485 if (!DrawingCanvas()->getDeviceClipBounds(&clip_bounds)) |
1486 return false; | 1486 return false; |
1487 return ComputeDirtyRect(local_rect, clip_bounds, dirty_rect); | 1487 return ComputeDirtyRect(local_rect, clip_bounds, dirty_rect); |
1488 } | 1488 } |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2138 ExpensiveCanvasHeuristicParameters::kShadowFixedCost[index] * | 2138 ExpensiveCanvasHeuristicParameters::kShadowFixedCost[index] * |
2139 usage_counters_.num_blurred_shadows + | 2139 usage_counters_.num_blurred_shadows + |
2140 ExpensiveCanvasHeuristicParameters:: | 2140 ExpensiveCanvasHeuristicParameters:: |
2141 kShadowVariableCostPerAreaTimesShadowBlurSquared[index] * | 2141 kShadowVariableCostPerAreaTimesShadowBlurSquared[index] * |
2142 usage_counters_.bounding_box_area_times_shadow_blur_squared; | 2142 usage_counters_.bounding_box_area_times_shadow_blur_squared; |
2143 | 2143 |
2144 return basic_cost_of_draw_calls + fill_type_adjustment + shadow_adjustment; | 2144 return basic_cost_of_draw_calls + fill_type_adjustment + shadow_adjustment; |
2145 } | 2145 } |
2146 | 2146 |
2147 } // namespace blink | 2147 } // namespace blink |
OLD | NEW |