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

Unified Diff: Source/platform/graphics/GraphicsTypes.cpp

Issue 671713006: Make parseCompositeAndBlendOperator() take care of "normal". (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix ASSERT, remove stale comments Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsTypes.cpp
diff --git a/Source/platform/graphics/GraphicsTypes.cpp b/Source/platform/graphics/GraphicsTypes.cpp
index 2b342058f701a5546de5f43b4ddb4b759dd93564..cf9b62027cd4b342a8b39bceb7c834cacb6709a5 100644
--- a/Source/platform/graphics/GraphicsTypes.cpp
+++ b/Source/platform/graphics/GraphicsTypes.cpp
@@ -49,6 +49,7 @@ static const char* const compositeOperatorNames[] = {
};
static const char* const blendOperatorNames[] = {
+ "normal",
"multiply",
"screen",
"overlay",
@@ -80,8 +81,7 @@ bool parseCompositeAndBlendOperator(const String& s, CompositeOperator& op, WebB
for (int i = 0; i < numBlendOperatorNames; i++) {
if (s == blendOperatorNames[i]) {
- blendOp = static_cast<WebBlendMode>(i+1);
- // For now, blending will always assume source-over. This will be fixed in the future
+ blendOp = static_cast<WebBlendMode>(i);
op = CompositeSourceOver;
return true;
}
@@ -90,16 +90,13 @@ bool parseCompositeAndBlendOperator(const String& s, CompositeOperator& op, WebB
return false;
}
-// FIXME: when we support blend modes in combination with compositing other than source-over
-// this routine needs to be updated.
String compositeOperatorName(CompositeOperator op, WebBlendMode blendOp)
{
ASSERT(op >= 0);
ASSERT(op < numCompositeOperatorNames);
ASSERT(blendOp >= 0);
- ASSERT(blendOp <= numBlendOperatorNames);
if (blendOp != WebBlendModeNormal)
- return blendOperatorNames[blendOp-1];
+ return blendOperatorNames[blendOp];
return compositeOperatorNames[op];
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698