Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp

Issue 2616093003: Make CSSParserContext be garbage collected. (Closed)
Patch Set: fix fuzzer compile Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 393 }
394 394
395 String BaseRenderingContext2D::filter() const { 395 String BaseRenderingContext2D::filter() const {
396 return state().unparsedFilter(); 396 return state().unparsedFilter();
397 } 397 }
398 398
399 void BaseRenderingContext2D::setFilter(const String& filterString) { 399 void BaseRenderingContext2D::setFilter(const String& filterString) {
400 if (filterString == state().unparsedFilter()) 400 if (filterString == state().unparsedFilter())
401 return; 401 return;
402 402
403 const CSSValue* filterValue = 403 const CSSValue* filterValue = CSSParser::parseSingleValue(
404 CSSParser::parseSingleValue(CSSPropertyFilter, filterString, 404 CSSPropertyFilter, filterString, new CSSParserContext(HTMLStandardMode));
405 CSSParserContext(HTMLStandardMode, nullptr));
406 405
407 if (!filterValue || filterValue->isInitialValue() || 406 if (!filterValue || filterValue->isInitialValue() ||
408 filterValue->isInheritedValue()) 407 filterValue->isInheritedValue())
409 return; 408 return;
410 409
411 modifiableState().setUnparsedFilter(filterString); 410 modifiableState().setUnparsedFilter(filterString);
412 modifiableState().setFilter(filterValue); 411 modifiableState().setFilter(filterValue);
413 snapshotStateForFilter(); 412 snapshotStateForFilter();
414 } 413 }
415 414
(...skipping 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after
2013 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] * 2012 ExpensiveCanvasHeuristicParameters::ShadowFixedCost[index] *
2014 m_usageCounters.numBlurredShadows + 2013 m_usageCounters.numBlurredShadows +
2015 ExpensiveCanvasHeuristicParameters:: 2014 ExpensiveCanvasHeuristicParameters::
2016 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] * 2015 ShadowVariableCostPerAreaTimesShadowBlurSquared[index] *
2017 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared; 2016 m_usageCounters.boundingBoxAreaTimesShadowBlurSquared;
2018 2017
2019 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment; 2018 return basicCostOfDrawCalls + fillTypeAdjustment + shadowAdjustment;
2020 } 2019 }
2021 2020
2022 } // namespace blink 2021 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698