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

Side by Side Diff: include/core/SkMask.h

Issue 286273002: Optimize CSS box-shadow performance by caching the SkMask of the blur effect. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase with latest skia in git instead of svn trunk Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | include/core/SkMaskFilter.h » ('j') | src/core/SkMaskFilter.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkMask_DEFINED 10 #ifndef SkMask_DEFINED
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 static uint8_t* AllocImage(size_t bytes); 129 static uint8_t* AllocImage(size_t bytes);
130 static void FreeImage(void* image); 130 static void FreeImage(void* image);
131 131
132 enum CreateMode { 132 enum CreateMode {
133 kJustComputeBounds_CreateMode, //!< compute bounds and return 133 kJustComputeBounds_CreateMode, //!< compute bounds and return
134 kJustRenderImage_CreateMode, //!< render into preallocate mask 134 kJustRenderImage_CreateMode, //!< render into preallocate mask
135 kComputeBoundsAndRenderImage_CreateMode //!< compute bounds, alloc imag e and render into it 135 kComputeBoundsAndRenderImage_CreateMode //!< compute bounds, alloc imag e and render into it
136 }; 136 };
137 }; 137 };
138 138
139 struct SkDiscardableMemoryMask {
Stephen White 2014/06/09 18:03:57 Naming nit: instead of baking "discardable memory"
140 SkMask fMask;
141 uint32_t fPixelGenerationID;
142 void* fCacheId;
143 };
144
139 /////////////////////////////////////////////////////////////////////////////// 145 ///////////////////////////////////////////////////////////////////////////////
140 146
141 /** 147 /**
142 * \class SkAutoMaskImage 148 * \class SkAutoMaskImage
143 * 149 *
144 * Stack class used to manage the fImage buffer in a SkMask. 150 * Stack class used to manage the fImage buffer in a SkMask.
145 * When this object loses scope, the buffer is freed with SkMask::FreeImage(). 151 * When this object loses scope, the buffer is freed with SkMask::FreeImage().
146 */ 152 */
147 class SkAutoMaskFreeImage { 153 class SkAutoMaskFreeImage {
148 public: 154 public:
149 SkAutoMaskFreeImage(uint8_t* maskImage) { 155 SkAutoMaskFreeImage(uint8_t* maskImage) {
150 fImage = maskImage; 156 fImage = maskImage;
151 } 157 }
152 158
153 ~SkAutoMaskFreeImage() { 159 ~SkAutoMaskFreeImage() {
154 SkMask::FreeImage(fImage); 160 SkMask::FreeImage(fImage);
155 } 161 }
156 162
157 private: 163 private:
158 uint8_t* fImage; 164 uint8_t* fImage;
159 }; 165 };
160 #define SkAutoMaskFreeImage(...) SK_REQUIRE_LOCAL_VAR(SkAutoMaskFreeImage) 166 #define SkAutoMaskFreeImage(...) SK_REQUIRE_LOCAL_VAR(SkAutoMaskFreeImage)
161 167
162 #endif 168 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkMaskFilter.h » ('j') | src/core/SkMaskFilter.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698