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

Side by Side Diff: Source/core/css/resolver/FilterOperationResolver.cpp

Issue 23601011: Have StyleResolver / StyleResolverState deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update StyleResolverState as well Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/css/RuleSet.cpp ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 { 226 {
227 // FIXME: Implement style resolution for the custom filter at-rule reference syntax. 227 // FIXME: Implement style resolution for the custom filter at-rule reference syntax.
228 UNUSED_PARAM(filterValue); 228 UNUSED_PARAM(filterValue);
229 return 0; 229 return 0;
230 } 230 }
231 231
232 static PassRefPtr<CustomFilterProgram> createCustomFilterProgram(CSSShaderValue* vertexShader, CSSShaderValue* fragmentShader, 232 static PassRefPtr<CustomFilterProgram> createCustomFilterProgram(CSSShaderValue* vertexShader, CSSShaderValue* fragmentShader,
233 CustomFilterProgramType programType, const CustomFilterProgramMixSettings& m ixSettings, CustomFilterMeshType meshType, 233 CustomFilterProgramType programType, const CustomFilterProgramMixSettings& m ixSettings, CustomFilterMeshType meshType,
234 StyleResolverState& state) 234 StyleResolverState& state)
235 { 235 {
236 ResourceFetcher* fetcher = state.document()->fetcher(); 236 ResourceFetcher* fetcher = state.document().fetcher();
237 KURL vertexShaderURL = vertexShader ? vertexShader->completeURL(fetcher) : K URL(); 237 KURL vertexShaderURL = vertexShader ? vertexShader->completeURL(fetcher) : K URL();
238 KURL fragmentShaderURL = fragmentShader ? fragmentShader->completeURL(fetche r) : KURL(); 238 KURL fragmentShaderURL = fragmentShader ? fragmentShader->completeURL(fetche r) : KURL();
239 RefPtr<StyleCustomFilterProgram> program = StyleCustomFilterProgram::create( vertexShaderURL, vertexShader ? styleShader(vertexShader, state) : 0, 239 RefPtr<StyleCustomFilterProgram> program = StyleCustomFilterProgram::create( vertexShaderURL, vertexShader ? styleShader(vertexShader, state) : 0,
240 fragmentShaderURL, fragmentShader ? styleShader(fragmentShader, stat e) : 0, programType, mixSettings, meshType); 240 fragmentShaderURL, fragmentShader ? styleShader(fragmentShader, stat e) : 0, programType, mixSettings, meshType);
241 // FIXME 241 // FIXME
242 // FIXME: Find out what the fixme above means. 242 // FIXME: Find out what the fixme above means.
243 return program.release(); 243 return program.release();
244 } 244 }
245 245
246 static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSy ntax(CSSFilterValue* filterValue, StyleResolverState& state) 246 static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSy ntax(CSSFilterValue* filterValue, StyleResolverState& state)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 395 }
396 if (operationType == FilterOperation::REFERENCE) { 396 if (operationType == FilterOperation::REFERENCE) {
397 if (filterValue->length() != 1) 397 if (filterValue->length() != 1)
398 continue; 398 continue;
399 CSSValue* argument = filterValue->itemWithoutBoundsCheck(0); 399 CSSValue* argument = filterValue->itemWithoutBoundsCheck(0);
400 400
401 if (!argument->isCSSSVGDocumentValue()) 401 if (!argument->isCSSSVGDocumentValue())
402 continue; 402 continue;
403 403
404 CSSSVGDocumentValue* svgDocumentValue = static_cast<CSSSVGDocumentVa lue*>(argument); 404 CSSSVGDocumentValue* svgDocumentValue = static_cast<CSSSVGDocumentVa lue*>(argument);
405 KURL url = state.document()->completeURL(svgDocumentValue->url()); 405 KURL url = state.document().completeURL(svgDocumentValue->url());
406 406
407 RefPtr<ReferenceFilterOperation> operation = ReferenceFilterOperatio n::create(svgDocumentValue->url(), url.fragmentIdentifier(), operationType); 407 RefPtr<ReferenceFilterOperation> operation = ReferenceFilterOperatio n::create(svgDocumentValue->url(), url.fragmentIdentifier(), operationType);
408 if (SVGURIReference::isExternalURIReference(svgDocumentValue->url(), state.document())) { 408 if (SVGURIReference::isExternalURIReference(svgDocumentValue->url(), &state.document())) {
409 if (!svgDocumentValue->loadRequested()) 409 if (!svgDocumentValue->loadRequested())
410 state.elementStyleResources().addPendingSVGDocument(operatio n.get(), svgDocumentValue); 410 state.elementStyleResources().addPendingSVGDocument(operatio n.get(), svgDocumentValue);
411 else if (svgDocumentValue->cachedSVGDocument()) 411 else if (svgDocumentValue->cachedSVGDocument())
412 operation->setDocumentResourceReference(adoptPtr(new Documen tResourceReference(svgDocumentValue->cachedSVGDocument()))); 412 operation->setDocumentResourceReference(adoptPtr(new Documen tResourceReference(svgDocumentValue->cachedSVGDocument())));
413 } 413 }
414 operations.operations().append(operation); 414 operations.operations().append(operation);
415 continue; 415 continue;
416 } 416 }
417 417
418 // Check that all parameters are primitive values, with the 418 // Check that all parameters are primitive values, with the
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 482
483 CSSValue* cssValue = filterValue->itemWithoutBoundsCheck(0); 483 CSSValue* cssValue = filterValue->itemWithoutBoundsCheck(0);
484 if (!cssValue->isShadowValue()) 484 if (!cssValue->isShadowValue())
485 continue; 485 continue;
486 486
487 ShadowValue* item = static_cast<ShadowValue*>(cssValue); 487 ShadowValue* item = static_cast<ShadowValue*>(cssValue);
488 IntPoint location(item->x->computeLength<int>(style, rootStyle, zoom Factor), item->y->computeLength<int>(style, rootStyle, zoomFactor)); 488 IntPoint location(item->x->computeLength<int>(style, rootStyle, zoom Factor), item->y->computeLength<int>(style, rootStyle, zoomFactor));
489 int blur = item->blur ? item->blur->computeLength<int>(style, rootSt yle, zoomFactor) : 0; 489 int blur = item->blur ? item->blur->computeLength<int>(style, rootSt yle, zoomFactor) : 0;
490 StyleColor shadowColor; 490 StyleColor shadowColor;
491 if (item->color) 491 if (item->color)
492 shadowColor = state.document()->textLinkColors().colorFromPrimit iveValue(item->color.get()); 492 shadowColor = state.document().textLinkColors().colorFromPrimiti veValue(item->color.get());
493 493
494 operations.operations().append(DropShadowFilterOperation::create(loc ation, blur, shadowColor.isValid() ? shadowColor.color() : Color::transparent, o perationType)); 494 operations.operations().append(DropShadowFilterOperation::create(loc ation, blur, shadowColor.isValid() ? shadowColor.color() : Color::transparent, o perationType));
495 break; 495 break;
496 } 496 }
497 case CSSFilterValue::UnknownFilterOperation: 497 case CSSFilterValue::UnknownFilterOperation:
498 default: 498 default:
499 ASSERT_NOT_REACHED(); 499 ASSERT_NOT_REACHED();
500 break; 500 break;
501 } 501 }
502 } 502 }
503 503
504 outOperations = operations; 504 outOperations = operations;
505 return true; 505 return true;
506 } 506 }
507 507
508 } // namespace WebCore 508 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/RuleSet.cpp ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698