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

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

Issue 1511003003: Use refs for non-null GraphicsContext, Scrollbar, etc. in scrollbar related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarRemove
Patch Set: yet another mac fix Created 5 years 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 // We can only draw the entire frame, clipped to the rect we want. So co mpute where the top left 309 // We can only draw the entire frame, clipped to the rect we want. So co mpute where the top left
310 // of the image would be if we were drawing without clipping, and transl ate accordingly. 310 // of the image would be if we were drawing without clipping, and transl ate accordingly.
311 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr cRect.height()); 311 FloatSize scale(dstRect.width() / srcRect.width(), dstRect.height() / sr cRect.height());
312 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect. location().y() * scale.height()); 312 FloatSize topLeftOffset(srcRect.location().x() * scale.width(), srcRect. location().y() * scale.height());
313 FloatPoint destOffset = dstRect.location() - topLeftOffset; 313 FloatPoint destOffset = dstRect.location() - topLeftOffset;
314 AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y()); 314 AffineTransform transform = AffineTransform::translation(destOffset.x(), destOffset.y());
315 transform.scale(scale.width(), scale.height()); 315 transform.scale(scale.width(), scale.height());
316 TransformRecorder transformRecorder(imagePicture.context(), *this, trans form); 316 TransformRecorder transformRecorder(imagePicture.context(), *this, trans form);
317 317
318 view->updateAllLifecyclePhases(); 318 view->updateAllLifecyclePhases();
319 view->paint(&imagePicture.context(), CullRect(enclosingIntRect(srcRect)) ); 319 view->paint(imagePicture.context(), CullRect(enclosingIntRect(srcRect))) ;
320 ASSERT(!view->needsLayout()); 320 ASSERT(!view->needsLayout());
321 } 321 }
322 322
323 { 323 {
324 SkAutoCanvasRestore ar(canvas, false); 324 SkAutoCanvasRestore ar(canvas, false);
325 if (drawNeedsLayer(paint)) { 325 if (drawNeedsLayer(paint)) {
326 SkRect layerRect = dstRect; 326 SkRect layerRect = dstRect;
327 canvas->saveLayer(&layerRect, &paint); 327 canvas->saveLayer(&layerRect, &paint);
328 } 328 }
329 RefPtr<const SkPicture> recording = imagePicture.endRecording(); 329 RefPtr<const SkPicture> recording = imagePicture.endRecording();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 509
510 return m_page; 510 return m_page;
511 } 511 }
512 512
513 String SVGImage::filenameExtension() const 513 String SVGImage::filenameExtension() const
514 { 514 {
515 return "svg"; 515 return "svg";
516 } 516 }
517 517
518 } 518 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/ScrollbarPainter.cpp ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698