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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 938943002: Allow GrGpuResources' unique keys to be changed. (Closed) Base URL: https://skia.googlesource.com/skia.git@rename
Patch Set: Address comments Created 5 years, 10 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 | « src/gpu/GrResourceCache.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.cpp » ('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 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
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 7
8 #include "SkGr.h" 8 #include "SkGr.h"
9 9
10 #include "GrXferProcessor.h" 10 #include "GrXferProcessor.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 static GrTexture* create_texture_for_bmp(GrContext* ctx, 173 static GrTexture* create_texture_for_bmp(GrContext* ctx,
174 const GrUniqueKey& optionalKey, 174 const GrUniqueKey& optionalKey,
175 GrSurfaceDesc desc, 175 GrSurfaceDesc desc,
176 SkPixelRef* pixelRefForInvalidationNoti fication, 176 SkPixelRef* pixelRefForInvalidationNoti fication,
177 const void* pixels, 177 const void* pixels,
178 size_t rowBytes) { 178 size_t rowBytes) {
179 GrTexture* result = ctx->createTexture(desc, true, pixels, rowBytes); 179 GrTexture* result = ctx->createTexture(desc, true, pixels, rowBytes);
180 if (result && optionalKey.isValid()) { 180 if (result && optionalKey.isValid()) {
181 BitmapInvalidator* listener = SkNEW_ARGS(BitmapInvalidator, (optionalKey )); 181 BitmapInvalidator* listener = SkNEW_ARGS(BitmapInvalidator, (optionalKey ));
182 pixelRefForInvalidationNotification->addGenIDChangeListener(listener); 182 pixelRefForInvalidationNotification->addGenIDChangeListener(listener);
183 SkAssertResult(ctx->addResourceToCache(optionalKey, result)); 183 ctx->addResourceToCache(optionalKey, result);
184 } 184 }
185 return result; 185 return result;
186 } 186 }
187 187
188 // creates a new texture that is the input texture scaled up to the next power o f two in 188 // creates a new texture that is the input texture scaled up to the next power o f two in
189 // width or height. If optionalKey is valid it will be set on the new texture. s tretch 189 // width or height. If optionalKey is valid it will be set on the new texture. s tretch
190 // controls whether the scaling is done using nearest or bilerp filtering. 190 // controls whether the scaling is done using nearest or bilerp filtering.
191 GrTexture* stretch_texture_to_next_pot(GrTexture* inputTexture, Stretch stretch, 191 GrTexture* stretch_texture_to_next_pot(GrTexture* inputTexture, Stretch stretch,
192 SkPixelRef* pixelRef, 192 SkPixelRef* pixelRef,
193 const GrUniqueKey& optionalKey) { 193 const GrUniqueKey& optionalKey) {
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) { 718 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) {
719 grPaint->addColorProcessor(fp)->unref(); 719 grPaint->addColorProcessor(fp)->unref();
720 constantColor = false; 720 constantColor = false;
721 } 721 }
722 } 722 }
723 723
724 // The grcolor is automatically set when calling asFragmentProcessor. 724 // The grcolor is automatically set when calling asFragmentProcessor.
725 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. 725 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint.
726 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint); 726 SkPaint2GrPaintNoShader(context, rt, skPaint, paintColor, constantColor, grP aint);
727 } 727 }
OLDNEW
« no previous file with comments | « src/gpu/GrResourceCache.cpp ('k') | src/gpu/effects/GrTextureStripAtlas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698