rendered paste body // Paint the color first underneath all images. if (!bgLayer->next()) { IntRect rect(_tx, clipy, w, cliph); // If we have an alpha and we are painting the root element, go ahead and blend with the base background color. if (isRoot() && (!bgColor.isValid() || bgColor.alpha() < 0xFF) && !isTransparent) { Color baseColor = view()->frameView()->baseBackgroundColor(); if (baseColor.alpha() > 0) { p->save(); p->setCompositeOperation(CompositeCopy); p->fillRect(rect, baseColor); p->restore(); } else p->clearRect(rect); } if (bgColor.isValid() && bgColor.alpha() > 0) p->fillRect(rect, bgColor); } // Paint the gradient/pattern underneath all images if (!isRoot()) { IntRect rect(_tx, clipy, w, cliph); CGColorSpaceRef cspace = CGColorSpaceCreateDeviceRGB(); struct CGFunctionCallbacks topCallbacks = { 0, TopGradientInterpolate, NULL }; CGFunctionRef topFunction = CGFunctionCreate(NULL, 1, NULL, 4, NULL, &topCallbacks); CGShadingRef shading = CGShadingCreateAxial(cspace, CGPointMake(0, 0), CGPointMake(0, 750), topFunction, false, false); p->save(); p->clip(IntRect(_tx, clipy, w, cliph)); CGContextDrawShading(p->platformContext(), shading); p->restore(); }