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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT 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 | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/SkGrPixelRef.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 "GrCaps.h" 10 #include "GrCaps.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 238
239 239
240 static GrTexture* create_texture_for_bmp(GrContext* ctx, 240 static GrTexture* create_texture_for_bmp(GrContext* ctx,
241 const GrUniqueKey& optionalKey, 241 const GrUniqueKey& optionalKey,
242 GrSurfaceDesc desc, 242 GrSurfaceDesc desc,
243 SkPixelRef* pixelRefForInvalidationNoti fication, 243 SkPixelRef* pixelRefForInvalidationNoti fication,
244 const void* pixels, 244 const void* pixels,
245 size_t rowBytes) { 245 size_t rowBytes) {
246 GrTexture* result = ctx->textureProvider()->createTexture(desc, true, pixels , rowBytes); 246 GrTexture* result = ctx->textureProvider()->createTexture(desc, true, pixels , rowBytes);
247 if (result && optionalKey.isValid()) { 247 if (result && optionalKey.isValid()) {
248 BitmapInvalidator* listener = SkNEW_ARGS(BitmapInvalidator, (optionalKey )); 248 BitmapInvalidator* listener = new BitmapInvalidator(optionalKey);
249 pixelRefForInvalidationNotification->addGenIDChangeListener(listener); 249 pixelRefForInvalidationNotification->addGenIDChangeListener(listener);
250 ctx->textureProvider()->assignUniqueKeyToTexture(optionalKey, result); 250 ctx->textureProvider()->assignUniqueKeyToTexture(optionalKey, result);
251 } 251 }
252 return result; 252 return result;
253 } 253 }
254 254
255 // creates a new texture that is the input texture scaled up. If optionalKey is valid it will be 255 // creates a new texture that is the input texture scaled up. If optionalKey is valid it will be
256 // set on the new texture. stretch controls whether the scaling is done using ne arest or bilerp 256 // set on the new texture. stretch controls whether the scaling is done using ne arest or bilerp
257 // filtering and the size to stretch the texture to. 257 // filtering and the size to stretch the texture to.
258 GrTexture* stretch_texture(GrTexture* inputTexture, const Stretch& stretch, 258 GrTexture* stretch_texture(GrTexture* inputTexture, const Stretch& stretch,
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 if (!GrPixelConfig2ColorAndProfileType(config, &ct, NULL)) { 885 if (!GrPixelConfig2ColorAndProfileType(config, &ct, NULL)) {
886 ct = kUnknown_SkColorType; 886 ct = kUnknown_SkColorType;
887 } 887 }
888 return SkImageInfo::Make(w, h, ct, at); 888 return SkImageInfo::Make(w, h, ct, at);
889 } 889 }
890 890
891 891
892 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap * dst) { 892 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap * dst) {
893 const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque); 893 const SkImageInfo info = GrMakeInfoFromTexture(src, w, h, isOpaque);
894 dst->setInfo(info); 894 dst->setInfo(info);
895 dst->setPixelRef(SkNEW_ARGS(SkGrPixelRef, (info, src)))->unref(); 895 dst->setPixelRef(new SkGrPixelRef(info, src))->unref();
896 } 896 }
897 897
898 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain tFilterQuality, 898 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain tFilterQuality,
899 const SkMatrix& view M, 899 const SkMatrix& view M,
900 const SkMatrix& loca lM, 900 const SkMatrix& loca lM,
901 bool* doBicubic) { 901 bool* doBicubic) {
902 *doBicubic = false; 902 *doBicubic = false;
903 GrTextureParams::FilterMode textureFilterMode; 903 GrTextureParams::FilterMode textureFilterMode;
904 switch (paintFilterQuality) { 904 switch (paintFilterQuality) {
905 case kNone_SkFilterQuality: 905 case kNone_SkFilterQuality:
(...skipping 23 matching lines...) Expand all
929 SkErrorInternals::SetError( kInvalidPaint_SkError, 929 SkErrorInternals::SetError( kInvalidPaint_SkError,
930 "Sorry, I don't understand the filtering " 930 "Sorry, I don't understand the filtering "
931 "mode you asked for. Falling back to " 931 "mode you asked for. Falling back to "
932 "MIPMaps."); 932 "MIPMaps.");
933 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 933 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
934 break; 934 break;
935 935
936 } 936 }
937 return textureFilterMode; 937 return textureFilterMode;
938 } 938 }
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/SkGrPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698