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

Side by Side Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 2768143002: Back PaintRecord with PaintOpBuffer instead of SkPicture (Closed)
Patch Set: Rebase, move slow path counting Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 } 363 }
364 364
365 bool SVGImage::applyShaderInternal(PaintFlags& flags, 365 bool SVGImage::applyShaderInternal(PaintFlags& flags,
366 const SkMatrix& localMatrix, 366 const SkMatrix& localMatrix,
367 const KURL& url) { 367 const KURL& url) {
368 const FloatSize size(containerSize()); 368 const FloatSize size(containerSize());
369 if (size.isEmpty()) 369 if (size.isEmpty())
370 return false; 370 return false;
371 371
372 const FloatRect bounds(FloatPoint(), size); 372 const FloatRect bounds(FloatPoint(), size);
373 flags.setShader(SkShader::MakePictureShader( 373 flags.setShader(
374 paintRecordForCurrentFrame(bounds, bounds, url), 374 MakePaintShaderRecord(paintRecordForCurrentFrame(bounds, bounds, url),
375 SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode, &localMatrix, 375 SkShader::kRepeat_TileMode,
376 nullptr)); 376 SkShader::kRepeat_TileMode, &localMatrix, nullptr));
377 377
378 // Animation is normally refreshed in draw() impls, which we don't reach when 378 // Animation is normally refreshed in draw() impls, which we don't reach when
379 // painting via shaders. 379 // painting via shaders.
380 startAnimation(); 380 startAnimation();
381 381
382 return true; 382 return true;
383 } 383 }
384 384
385 bool SVGImage::applyShader(PaintFlags& flags, const SkMatrix& localMatrix) { 385 bool SVGImage::applyShader(PaintFlags& flags, const SkMatrix& localMatrix) {
386 return applyShaderInternal(flags, localMatrix, KURL()); 386 return applyShaderInternal(flags, localMatrix, KURL());
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 } 704 }
705 705
706 return m_page ? SizeAvailable : SizeUnavailable; 706 return m_page ? SizeAvailable : SizeUnavailable;
707 } 707 }
708 708
709 String SVGImage::filenameExtension() const { 709 String SVGImage::filenameExtension() const {
710 return "svg"; 710 return "svg";
711 } 711 }
712 712
713 } // namespace blink 713 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698