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

Side by Side Diff: Source/core/platform/graphics/Pattern.h

Issue 18718002: Use RefPtr to manage shaders in Gradient and Pattern. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
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) 2007-2008 Torch Mobile, Inc. 4 * Copyright (C) 2007-2008 Torch Mobile, Inc.
5 * Copyright (C) 2013 Google, Inc. All rights reserved. 5 * Copyright (C) 2013 Google, Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 29 matching lines...) Expand all
40 namespace WebCore { 40 namespace WebCore {
41 41
42 class AffineTransform; 42 class AffineTransform;
43 43
44 class Pattern : public RefCounted<Pattern> { 44 class Pattern : public RefCounted<Pattern> {
45 public: 45 public:
46 static PassRefPtr<Pattern> create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY) 46 static PassRefPtr<Pattern> create(PassRefPtr<Image> tileImage, bool repeatX, bool repeatY)
47 { 47 {
48 return adoptRef(new Pattern(tileImage, repeatX, repeatY)); 48 return adoptRef(new Pattern(tileImage, repeatX, repeatY));
49 } 49 }
50 virtual ~Pattern(); 50 ~Pattern();
51 51
52 Image* tileImage() const { return m_tileImage.get(); } 52 Image* tileImage() const { return m_tileImage.get(); }
53 53
54 SkShader* shader(); 54 SkShader* shader();
55 55
56 void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformat ion); 56 void setPatternSpaceTransform(const AffineTransform& patternSpaceTransformat ion);
57 const AffineTransform& getPatternSpaceTransform() { return m_patternSpaceTra nsformation; }; 57 const AffineTransform& getPatternSpaceTransform() { return m_patternSpaceTra nsformation; };
58 58
59 bool repeatX() const { return m_repeatX; } 59 bool repeatX() const { return m_repeatX; }
60 bool repeatY() const { return m_repeatY; } 60 bool repeatY() const { return m_repeatY; }
61 61
62 private: 62 private:
63 Pattern(PassRefPtr<Image>, bool repeatX, bool repeatY); 63 Pattern(PassRefPtr<Image>, bool repeatX, bool repeatY);
64 64
65 RefPtr<Image> m_tileImage; 65 RefPtr<Image> m_tileImage;
66 bool m_repeatX; 66 bool m_repeatX;
67 bool m_repeatY; 67 bool m_repeatY;
68 AffineTransform m_patternSpaceTransformation; 68 AffineTransform m_patternSpaceTransformation;
69 SkShader* m_pattern; 69 RefPtr<SkShader> m_pattern;
70 int m_externalMemoryAllocated; 70 int m_externalMemoryAllocated;
71 }; 71 };
72 72
73 } //namespace 73 } //namespace
74 74
75 #endif 75 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698