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

Side by Side Diff: Source/core/rendering/svg/SVGRenderingContext.cpp

Issue 399213002: Change GraphicsContext::createCompatibleBuffer to return something non-null (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rename Created 6 years, 5 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 | « no previous file | Source/platform/graphics/CrossfadeGeneratedImage.cpp » ('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) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 if (imageBuffer) { 287 if (imageBuffer) {
288 AffineTransform transform = m_paintInfo->context->getCTM(); 288 AffineTransform transform = m_paintInfo->context->getCTM();
289 IntSize expandedBoundingBox = expandedIntSize(boundingBox.size()); 289 IntSize expandedBoundingBox = expandedIntSize(boundingBox.size());
290 IntSize bufferSize(static_cast<int>(ceil(expandedBoundingBox.width() * t ransform.xScale())), static_cast<int>(ceil(expandedBoundingBox.height() * transf orm.yScale()))); 290 IntSize bufferSize(static_cast<int>(ceil(expandedBoundingBox.width() * t ransform.xScale())), static_cast<int>(ceil(expandedBoundingBox.height() * transf orm.yScale())));
291 if (bufferSize != imageBuffer->size()) 291 if (bufferSize != imageBuffer->size())
292 imageBuffer.clear(); 292 imageBuffer.clear();
293 } 293 }
294 294
295 // Create a new buffer and paint the foreground into it. 295 // Create a new buffer and paint the foreground into it.
296 if (!imageBuffer) { 296 if (!imageBuffer) {
297 if ((imageBuffer = m_paintInfo->context->createCompatibleBuffer(expanded IntSize(boundingBox.size())))) { 297 if ((imageBuffer = m_paintInfo->context->createRasterBuffer(expandedIntS ize(boundingBox.size())))) {
298 GraphicsContext* bufferedRenderingContext = imageBuffer->context(); 298 GraphicsContext* bufferedRenderingContext = imageBuffer->context();
299 bufferedRenderingContext->translate(-boundingBox.x(), -boundingBox.y ()); 299 bufferedRenderingContext->translate(-boundingBox.x(), -boundingBox.y ());
300 PaintInfo bufferedInfo(*m_paintInfo); 300 PaintInfo bufferedInfo(*m_paintInfo);
301 bufferedInfo.context = bufferedRenderingContext; 301 bufferedInfo.context = bufferedRenderingContext;
302 toRenderSVGImage(m_object)->paintForeground(bufferedInfo); 302 toRenderSVGImage(m_object)->paintForeground(bufferedInfo);
303 } else 303 } else
304 return false; 304 return false;
305 } 305 }
306 306
307 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox); 307 m_paintInfo->context->drawImageBuffer(imageBuffer.get(), boundingBox);
308 return true; 308 return true;
309 } 309 }
310 310
311 } 311 }
OLDNEW
« no previous file with comments | « no previous file | Source/platform/graphics/CrossfadeGeneratedImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698