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

Side by Side Diff: include/gpu/SkGr.h

Issue 1315353006: refactor parts of SkGr.cpp for use by SkImages (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix nits Created 5 years, 3 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 | « gyp/gpu.gypi ('k') | src/gpu/GrYUVProvider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
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 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return GrColorPackRGBA(r, g, b, a); 62 return GrColorPackRGBA(r, g, b, a);
63 } 63 }
64 64
65 static inline GrColor SkColor2GrColorJustAlpha(SkColor c) { 65 static inline GrColor SkColor2GrColorJustAlpha(SkColor c) {
66 U8CPU a = SkColorGetA(c); 66 U8CPU a = SkColorGetA(c);
67 return GrColorPackRGBA(a, a, a, a); 67 return GrColorPackRGBA(a, a, a, a);
68 } 68 }
69 69
70 //////////////////////////////////////////////////////////////////////////////// 70 ////////////////////////////////////////////////////////////////////////////////
71 71
72 /**
73 * If the compressed data in the SkData is supported (as a texture format, this returns
74 * the pixel-config that should be used, and sets outStartOfDataToUpload to the ptr into
75 * the data where the actual raw data starts (skipping any header bytes).
76 *
77 * If the compressed data is not supported, this returns kUnknown_GrPixelConfig , and
78 * ignores outStartOfDataToUpload.
79 */
80 GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data,
81 int expectedW, int expectedH,
82 const void** outStartOfDataToUp load);
83
72 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams* ); 84 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams* );
73 85
74 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture Params*); 86 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture Params*);
75 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, SkImageUsageTyp e); 87 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, SkImageUsageTyp e);
76 88
89 GrTexture* GrCreateTextureForPixels(GrContext*, const GrUniqueKey& optionalKey, GrSurfaceDesc,
90 SkPixelRef* pixelRefForInvalidationNotificat ionOrNull,
91 const void* pixels, size_t rowBytesOrZero);
92
77 //////////////////////////////////////////////////////////////////////////////// 93 ////////////////////////////////////////////////////////////////////////////////
78 94
79 // Converts a SkPaint to a GrPaint, ignoring the SkPaint's shader. 95 // Converts a SkPaint to a GrPaint, ignoring the SkPaint's shader.
80 // Sets the color of GrPaint to the value of the parameter paintColor 96 // Sets the color of GrPaint to the value of the parameter paintColor
81 // Callers may subsequently modify the GrPaint. Setting constantColor indicates 97 // Callers may subsequently modify the GrPaint. Setting constantColor indicates
82 // that the final paint will draw the same color at every pixel. This allows 98 // that the final paint will draw the same color at every pixel. This allows
83 // an optimization where the color filter can be applied to the SkPaint's 99 // an optimization where the color filter can be applied to the SkPaint's
84 // color once while converting to GrPaint and then ignored. TODO: Remove this 100 // color once while converting to GrPaint and then ignored. TODO: Remove this
85 // bool and use the invariant info to automatically apply the color filter. 101 // bool and use the invariant info to automatically apply the color filter.
86 bool SkPaint2GrPaintNoShader(GrContext* context, GrRenderTarget*, const SkPaint& skPaint, 102 bool SkPaint2GrPaintNoShader(GrContext* context, GrRenderTarget*, const SkPaint& skPaint,
(...skipping 17 matching lines...) Expand all
104 bool* doBicubic); 120 bool* doBicubic);
105 121
106 //////////////////////////////////////////////////////////////////////////////// 122 ////////////////////////////////////////////////////////////////////////////////
107 // Classes 123 // Classes
108 124
109 class SkGlyphCache; 125 class SkGlyphCache;
110 126
111 //////////////////////////////////////////////////////////////////////////////// 127 ////////////////////////////////////////////////////////////////////////////////
112 128
113 #endif 129 #endif
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrYUVProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698