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

Side by Side Diff: gm/image_pict.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/dcshader.cpp ('k') | gm/texturedomaineffect.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 2015 Google Inc. 2 * Copyright 2015 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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 static void draw_as_bitmap(SkCanvas* canvas, SkImageCacherator* cache, SkSca lar x, SkScalar y) { 309 static void draw_as_bitmap(SkCanvas* canvas, SkImageCacherator* cache, SkSca lar x, SkScalar y) {
310 SkBitmap bitmap; 310 SkBitmap bitmap;
311 cache->lockAsBitmap(&bitmap, nullptr); 311 cache->lockAsBitmap(&bitmap, nullptr);
312 canvas->drawBitmap(bitmap, x, y); 312 canvas->drawBitmap(bitmap, x, y);
313 } 313 }
314 314
315 static void draw_as_tex(SkCanvas* canvas, SkImageCacherator* cache, SkScalar x, SkScalar y) { 315 static void draw_as_tex(SkCanvas* canvas, SkImageCacherator* cache, SkScalar x, SkScalar y) {
316 #if SK_SUPPORT_GPU 316 #if SK_SUPPORT_GPU
317 SkAutoTUnref<GrTexture> texture(cache->lockAsTexture(canvas->getGrContex t(), 317 SkAutoTUnref<GrTexture> texture(cache->lockAsTexture(canvas->getGrContex t(),
318 GrTextureParams::Cl ampBilerp(), 318 GrTextureParams::Cl ampBilerp(),
319 SkSourceGammaTreatm ent::kRespect,
319 nullptr)); 320 nullptr));
320 if (!texture) { 321 if (!texture) {
321 // show placeholder if we have no texture 322 // show placeholder if we have no texture
322 SkPaint paint; 323 SkPaint paint;
323 paint.setStyle(SkPaint::kStroke_Style); 324 paint.setStyle(SkPaint::kStroke_Style);
324 SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width( )), 325 SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width( )),
325 SkIntToScalar(cache->info().width())); 326 SkIntToScalar(cache->info().width()));
326 canvas->drawRect(r, paint); 327 canvas->drawRect(r, paint);
327 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint); 328 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint);
328 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint); 329 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 373
373 private: 374 private:
374 typedef skiagm::GM INHERITED; 375 typedef skiagm::GM INHERITED;
375 }; 376 };
376 DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); ) 377 DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); )
377 DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); ) 378 DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); )
378 DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); ) 379 DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); )
379 #if SK_SUPPORT_GPU 380 #if SK_SUPPORT_GPU
380 DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); ) 381 DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); )
381 #endif 382 #endif
OLDNEW
« no previous file with comments | « gm/dcshader.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698