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

Side by Side Diff: gm/texturedomaineffect.cpp

Issue 2037413002: Add SkSourceGammaTreatment enum so we know how to create mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix DM compilation Created 4 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
« no previous file with comments | « gm/image_pict.cpp ('k') | gm/yuvtorgbeffect.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 2014 Google Inc. 2 * Copyright 2014 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 // This test only works with the GPU backend. 8 // This test only works with the GPU backend.
9 9
10 #include "gm.h" 10 #include "gm.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 skiagm::GM::DrawGpuOnlyMessage(canvas); 75 skiagm::GM::DrawGpuOnlyMessage(canvas);
76 return; 76 return;
77 } 77 }
78 78
79 GrContext* context = canvas->getGrContext(); 79 GrContext* context = canvas->getGrContext();
80 if (!context) { 80 if (!context) {
81 return; 81 return;
82 } 82 }
83 83
84 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fBmp, 84 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(context, fBmp,
85 GrTextureParams ::ClampNoFilter())); 85 GrTextureParams ::ClampNoFilter(),
86 SkSourceGammaTr eatment::kRespect));
86 if (!texture) { 87 if (!texture) {
87 return; 88 return;
88 } 89 }
89 90
90 SkTArray<SkMatrix> textureMatrices; 91 SkTArray<SkMatrix> textureMatrices;
91 textureMatrices.push_back().setIDiv(texture->width(), texture->height()) ; 92 textureMatrices.push_back().setIDiv(texture->width(), texture->height()) ;
92 textureMatrices.push_back() = textureMatrices[0]; 93 textureMatrices.push_back() = textureMatrices[0];
93 textureMatrices.back().postScale(1.5f, 0.85f); 94 textureMatrices.back().postScale(1.5f, 0.85f);
94 textureMatrices.push_back() = textureMatrices[0]; 95 textureMatrices.push_back() = textureMatrices[0];
95 textureMatrices.back().preRotate(45.f, texture->width() / 2.f, texture-> height() / 2.f); 96 textureMatrices.back().preRotate(45.f, texture->width() / 2.f, texture-> height() / 2.f);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 }; 150 };
150 151
151 // Windows builds did not like SkScalar initialization in class :( 152 // Windows builds did not like SkScalar initialization in class :(
152 const SkScalar TextureDomainEffect::kDrawPad = 10.f; 153 const SkScalar TextureDomainEffect::kDrawPad = 10.f;
153 const SkScalar TextureDomainEffect::kTestPad = 10.f; 154 const SkScalar TextureDomainEffect::kTestPad = 10.f;
154 155
155 DEF_GM(return new TextureDomainEffect;) 156 DEF_GM(return new TextureDomainEffect;)
156 } 157 }
157 158
158 #endif 159 #endif
OLDNEW
« no previous file with comments | « gm/image_pict.cpp ('k') | gm/yuvtorgbeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698