Change background-repeat default to no-repeat

Previously, if you had a generated background image and a translucent (or
rounded) border, we would draw the image nine times because we would inflate
the fill rect to draw behind the border. With no-repeat, we only draw the image
once.

This saves 4.5% of record time on flights-app.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/844193009
This commit is contained in:
Adam Barth 2015-01-21 16:42:26 -08:00
parent 317474975f
commit 49e664d6ac
4 changed files with 4 additions and 5 deletions

View File

@ -183,8 +183,8 @@ public:
static EFillAttachment initialFillAttachment(EFillLayerType) { return ScrollBackgroundAttachment; }
static EFillBox initialFillClip(EFillLayerType) { return BorderFillBox; }
static EFillBox initialFillOrigin(EFillLayerType type) { return type == BackgroundFillLayer ? PaddingFillBox : BorderFillBox; }
static EFillRepeat initialFillRepeatX(EFillLayerType) { return RepeatFill; }
static EFillRepeat initialFillRepeatY(EFillLayerType) { return RepeatFill; }
static EFillRepeat initialFillRepeatX(EFillLayerType) { return NoRepeatFill; }
static EFillRepeat initialFillRepeatY(EFillLayerType) { return NoRepeatFill; }
static CompositeOperator initialFillComposite(EFillLayerType) { return CompositeSourceOver; }
static WebBlendMode initialFillBlendMode(EFillLayerType) { return WebBlendModeNormal; }
static EFillSizeType initialFillSizeType(EFillLayerType) { return SizeLength; }

View File

@ -9,7 +9,6 @@
right: 32px;
max-width: 55%;
box-shadow: 0px 0px 12px 2px rgba(22, 22, 22, 0.4);
background-color: #b0281a;
background-image: linear-gradient(#E5D658, #DFCF43);
border: 1px solid #AEA477;
padding: 6px;

View File

@ -139,7 +139,7 @@ layer at (0,77) size 800x586
RenderText {#text} at (0,0) size 36x17
text run at (0,0) width 36: "$367"
layer at (609,509) size 159x59
RenderFlexibleBox {app-toast} at (609.31,509) size 158.69x59 [bgcolor=#B0281A] [border: (1px solid #AEA477)]
RenderFlexibleBox {app-toast} at (609.31,509) size 158.69x59 [border: (1px solid #AEA477)]
RenderBlock {div} at (7,13.50) size 32x32
RenderBlock {div} at (0,0) size 32x32 [border: (2px solid #000000)]
RenderBlock {t} at (2,2) size 28x30

View File

@ -1,7 +1,7 @@
<sky>
<import src="../resources/run-after-display.sky" as="runAfterDisplay" />
<img src="http://storage.googleapis.com/mojo/sky-pngs/98fa15c068ac4f3365281003ed145840a89e7c71" />
<img src="http://storage.googleapis.com/mojo/sky-pngs/b00464d27228747bd0a9fd5ed2fe1da78a4c9548" />
<script>
window.addEventListener('load', function() {