1 // Copyright (c) 2010 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 5 (function() { 6 var a = 7; 7 var a2 = a / 2; 8 var ctx = document.getCSSCanvasContext('2d', 'tree-triangle', a + 1, a2 + 2); 9 10 ctx.fillStyle = '#000'; 11 ctx.translate(.5, .5); 12 13 ctx.beginPath(); 14 ctx.moveTo(0, 0); 15 ctx.lineTo(0, 1); 16 ctx.lineTo(a2, 1 + a2); 17 ctx.lineTo(a, 1); 18 ctx.lineTo(a, 0); 19 ctx.closePath(); 20 ctx.fill(); 21 ctx.stroke(); 22 })(); 23