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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/Pattern.cpp

Issue 1786183002: Revert of Switch Blink SkShader clients to sk_sp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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, 2007, 2008 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 3 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
4 * Copyright (C) 2013 Google, Inc. All rights reserved. 4 * Copyright (C) 2013 Google, Inc. 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 { 58 {
59 adjustExternalMemoryAllocated(-m_externalMemoryAllocated); 59 adjustExternalMemoryAllocated(-m_externalMemoryAllocated);
60 } 60 }
61 61
62 void Pattern::applyToPaint(SkPaint& paint) 62 void Pattern::applyToPaint(SkPaint& paint)
63 { 63 {
64 if (!m_pattern) { 64 if (!m_pattern) {
65 m_pattern = createShader(); 65 m_pattern = createShader();
66 } 66 }
67 67
68 paint.setShader(m_pattern); 68 paint.setShader(m_pattern.get());
69 } 69 }
70 70
71 void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransf ormation) 71 void Pattern::setPatternSpaceTransform(const AffineTransform& patternSpaceTransf ormation)
72 { 72 {
73 if (patternSpaceTransformation == m_patternSpaceTransformation) 73 if (patternSpaceTransformation == m_patternSpaceTransformation)
74 return; 74 return;
75 75
76 m_patternSpaceTransformation = patternSpaceTransformation; 76 m_patternSpaceTransformation = patternSpaceTransformation;
77 m_pattern.reset(); 77 m_pattern.clear();
78 } 78 }
79 79
80 void Pattern::adjustExternalMemoryAllocated(int64_t delta) 80 void Pattern::adjustExternalMemoryAllocated(int64_t delta)
81 { 81 {
82 delta = std::max(-m_externalMemoryAllocated, delta); 82 delta = std::max(-m_externalMemoryAllocated, delta);
83 83
84 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(delta); 84 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(delta);
85 85
86 m_externalMemoryAllocated += delta; 86 m_externalMemoryAllocated += delta;
87 } 87 }
88 88
89 } // namespace blink 89 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/Pattern.h ('k') | third_party/WebKit/Source/platform/graphics/PicturePattern.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698