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

Side by Side Diff: src/core/SkBitmapProcShader.h

Issue 2222593003: use tmp allocator for images in temp shaders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | src/core/SkImagePriv.h » ('j') | src/image/SkImage_Raster.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #ifndef SkBitmapProcShader_DEFINED 7 #ifndef SkBitmapProcShader_DEFINED
8 #define SkBitmapProcShader_DEFINED 8 #define SkBitmapProcShader_DEFINED
9 9
10 #include "SkImagePriv.h" 10 #include "SkImagePriv.h"
11 #include "SkShader.h" 11 #include "SkShader.h"
12 #include "SkSmallAllocator.h"
13 12
14 struct SkBitmapProcState;
15 class SkBitmapProvider; 13 class SkBitmapProvider;
16 14
17 class SkBitmapProcLegacyShader : public SkShader { 15 class SkBitmapProcLegacyShader : public SkShader {
18 private: 16 private:
19 friend class SkImageShader; 17 friend class SkImageShader;
20 18
21 static size_t ContextSize(const ContextRec&, const SkImageInfo& srcInfo); 19 static size_t ContextSize(const ContextRec&, const SkImageInfo& srcInfo);
22 static Context* MakeContext(const SkShader&, TileMode tmx, TileMode tmy, 20 static Context* MakeContext(const SkShader&, TileMode tmx, TileMode tmy,
23 const SkBitmapProvider&, const ContextRec&, void * storage); 21 const SkBitmapProvider&, const ContextRec&, void * storage);
24 22
25 typedef SkShader INHERITED; 23 typedef SkShader INHERITED;
26 }; 24 };
27 25
28 enum {kSkBlitterContextSize = 3332};
29
30 // Commonly used allocator. It currently is only used to allocate up to 3 object s. The total
31 // bytes requested is calculated using one of our large shaders, its context siz e plus the size of
32 // an Sk3DBlitter in SkDraw.cpp
33 // Note that some contexts may contain other contexts (e.g. for compose shaders) , but we've not
34 // yet found a situation where the size below isn't big enough.
35 typedef SkSmallAllocator<3, kSkBlitterContextSize> SkTBlitterAllocator;
36
37 // If alloc is non-nullptr, it will be used to allocate the returned SkShader, a nd MUST outlive
38 // the SkShader.
39 sk_sp<SkShader> SkMakeBitmapShader(const SkBitmap& src, SkShader::TileMode, SkSh ader::TileMode,
40 const SkMatrix* localMatrix, SkCopyPixelsMode ,
41 SkTBlitterAllocator* alloc);
42
43 #endif 26 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkImagePriv.h » ('j') | src/image/SkImage_Raster.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698