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

Side by Side Diff: Source/core/css/CSSGradientValue.cpp

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 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
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSLengthFunctions.h » ('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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 // Need to look up our size. Create a string of width*height to use as a hash key. 56 // Need to look up our size. Create a string of width*height to use as a hash key.
57 Image* result = getImage(renderer, size); 57 Image* result = getImage(renderer, size);
58 if (result) 58 if (result)
59 return result; 59 return result;
60 } 60 }
61 61
62 // We need to create an image. 62 // We need to create an image.
63 RefPtr<Gradient> gradient; 63 RefPtr<Gradient> gradient;
64 64
65 RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle (); 65 RenderStyle* rootStyle = renderer->document().documentElement()->renderStyle ();
66 CSSToLengthConversionData conversionData(renderer->style(), rootStyle); 66 CSSToLengthConversionData conversionData(renderer->style(), rootStyle, rende rer->view());
67 if (isLinearGradientValue()) 67 if (isLinearGradientValue())
68 gradient = toCSSLinearGradientValue(this)->createGradient(conversionData , size); 68 gradient = toCSSLinearGradientValue(this)->createGradient(conversionData , size);
69 else 69 else
70 gradient = toCSSRadialGradientValue(this)->createGradient(conversionData , size); 70 gradient = toCSSRadialGradientValue(this)->createGradient(conversionData , size);
71 71
72 RefPtr<Image> newImage = GradientGeneratedImage::create(gradient, size); 72 RefPtr<Image> newImage = GradientGeneratedImage::create(gradient, size);
73 if (cacheable) 73 if (cacheable)
74 putImage(size, newImage); 74 putImage(size, newImage);
75 75
76 return newImage.release(); 76 return newImage.release();
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 equalHorizontalAndVerticalSize = compareCSSValuePtr(m_endHorizontalSize, other.m_endHorizontalSize) && compareCSSValuePtr(m_endVerticalSize, other.m_end VerticalSize); 1155 equalHorizontalAndVerticalSize = compareCSSValuePtr(m_endHorizontalSize, other.m_endHorizontalSize) && compareCSSValuePtr(m_endVerticalSize, other.m_end VerticalSize);
1156 else { 1156 else {
1157 equalShape = !other.m_shape; 1157 equalShape = !other.m_shape;
1158 equalSizingBehavior = !other.m_sizingBehavior; 1158 equalSizingBehavior = !other.m_sizingBehavior;
1159 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_ endVerticalSize; 1159 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_ endVerticalSize;
1160 } 1160 }
1161 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize & & m_stops == other.m_stops; 1161 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize & & m_stops == other.m_stops;
1162 } 1162 }
1163 1163
1164 } // namespace WebCore 1164 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/css/CSSLengthFunctions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698