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

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

Issue 16415007: Cleanup usage of CSSPropertyID and CSSValueID inside Blink. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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
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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 CSSMixFunctionValue* mixFunction = static_cast<CSSMixFunctionValue*> (fragmentShaderOrMixFunction); 271 CSSMixFunctionValue* mixFunction = static_cast<CSSMixFunctionValue*> (fragmentShaderOrMixFunction);
272 CSSValueListIterator iterator(mixFunction); 272 CSSValueListIterator iterator(mixFunction);
273 273
274 ASSERT(mixFunction->length()); 274 ASSERT(mixFunction->length());
275 fragmentShader = toCSSShaderValue(iterator.value()); 275 fragmentShader = toCSSShaderValue(iterator.value());
276 iterator.advance(); 276 iterator.advance();
277 277
278 ASSERT(mixFunction->length() <= 3); 278 ASSERT(mixFunction->length() <= 3);
279 while (iterator.hasMore()) { 279 while (iterator.hasMore()) {
280 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator .value()); 280 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator .value());
281 if (CSSParser::isBlendMode(primitiveValue->getIdent())) 281 if (CSSParser::isBlendMode(primitiveValue->getValueID()))
282 mixSettings.blendMode = *primitiveValue; 282 mixSettings.blendMode = *primitiveValue;
283 else if (CSSParser::isCompositeOperator(primitiveValue->getIdent ())) 283 else if (CSSParser::isCompositeOperator(primitiveValue->getValue ID()))
284 mixSettings.compositeOperator = *primitiveValue; 284 mixSettings.compositeOperator = *primitiveValue;
285 else 285 else
286 ASSERT_NOT_REACHED(); 286 ASSERT_NOT_REACHED();
287 iterator.advance(); 287 iterator.advance();
288 } 288 }
289 } else { 289 } else {
290 programType = PROGRAM_TYPE_NO_ELEMENT_TEXTURE; 290 programType = PROGRAM_TYPE_NO_ELEMENT_TEXTURE;
291 fragmentShader = toCSSShaderValue(fragmentShaderOrMixFunction); 291 fragmentShader = toCSSShaderValue(fragmentShaderOrMixFunction);
292 } 292 }
293 } 293 }
(...skipping 28 matching lines...) Expand all
322 if (primitiveValue->isNumber()) { 322 if (primitiveValue->isNumber()) {
323 meshRows = primitiveValue->getIntValue(); 323 meshRows = primitiveValue->getIntValue();
324 iterator.advance(); 324 iterator.advance();
325 } 325 }
326 } 326 }
327 } 327 }
328 } 328 }
329 329
330 if (iterator.hasMore() && iterator.isPrimitiveValue()) { 330 if (iterator.hasMore() && iterator.isPrimitiveValue()) {
331 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.val ue()); 331 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(iterator.val ue());
332 if (primitiveValue->getIdent() == CSSValueDetached) { 332 if (primitiveValue->getValueID() == CSSValueDetached) {
333 meshType = MeshTypeDetached; 333 meshType = MeshTypeDetached;
334 iterator.advance(); 334 iterator.advance();
335 } 335 }
336 } 336 }
337 337
338 if (!iterator.index()) { 338 if (!iterator.index()) {
339 // If no value was consumed from the mesh value, then it is just a p arameter list, meaning that we end up 339 // If no value was consumed from the mesh value, then it is just a p arameter list, meaning that we end up
340 // having just two CSSListValues: list of shaders and list of parame ters. 340 // having just two CSSListValues: list of shaders and list of parame ters.
341 ASSERT(filterValue->length() == 2); 341 ASSERT(filterValue->length() == 2);
342 parametersValue = filterValue->itemWithoutBoundsCheck(1); 342 parametersValue = filterValue->itemWithoutBoundsCheck(1);
(...skipping 21 matching lines...) Expand all
364 364
365 bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, RenderSt yle* style, RenderStyle* rootStyle, FilterOperations& outOperations, StyleCustom FilterProgramCache* customFilterProgramCache, StyleResolverState& state) 365 bool FilterOperationResolver::createFilterOperations(CSSValue* inValue, RenderSt yle* style, RenderStyle* rootStyle, FilterOperations& outOperations, StyleCustom FilterProgramCache* customFilterProgramCache, StyleResolverState& state)
366 { 366 {
367 ASSERT(outOperations.isEmpty()); 367 ASSERT(outOperations.isEmpty());
368 368
369 if (!inValue) 369 if (!inValue)
370 return false; 370 return false;
371 371
372 if (inValue->isPrimitiveValue()) { 372 if (inValue->isPrimitiveValue()) {
373 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inValue); 373 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(inValue);
374 if (primitiveValue->getIdent() == CSSValueNone) 374 if (primitiveValue->getValueID() == CSSValueNone)
375 return true; 375 return true;
376 } 376 }
377 377
378 if (!inValue->isValueList()) 378 if (!inValue->isValueList())
379 return false; 379 return false;
380 380
381 float zoomFactor = style ? style->effectiveZoom() : 1; 381 float zoomFactor = style ? style->effectiveZoom() : 1;
382 FilterOperations operations; 382 FilterOperations operations;
383 for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) { 383 for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
384 CSSValue* currValue = i.value(); 384 CSSValue* currValue = i.value();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 ASSERT_NOT_REACHED(); 507 ASSERT_NOT_REACHED();
508 break; 508 break;
509 } 509 }
510 } 510 }
511 511
512 outOperations = operations; 512 outOperations = operations;
513 return true; 513 return true;
514 } 514 }
515 515
516 } // namespace WebCore 516 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/StylePropertySerializer.cpp ('k') | Source/core/css/resolver/StyleBuilderCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698