- add sources.
[platform/framework/web/crosswalk.git] / src / tools / perf / page_sets / tough_canvas_cases / canvas2d_balls_common / bouncing_balls_draw_back_as_gradient.js
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 var backGradient;
5 function prepareBackground() {
6   backGradient = canvasContext.createLinearGradient(0, 0, canvasWidth, 0);
7   backGradient.addColorStop(0, "#FF4040");
8   backGradient.addColorStop(1, "#40FF40");
9 }
10
11 function drawBackground() {
12   canvasContext.save();
13   canvasContext.fillStyle = backGradient;
14   canvasContext.fillRect(0, 0, canvasWidth, canvasHeight);
15   canvasContext.restore();
16 }