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

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: Remove leftover comments 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
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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
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(), false,
319 nullptr)); 319 nullptr));
320 if (!texture) { 320 if (!texture) {
321 // show placeholder if we have no texture 321 // show placeholder if we have no texture
322 SkPaint paint; 322 SkPaint paint;
323 paint.setStyle(SkPaint::kStroke_Style); 323 paint.setStyle(SkPaint::kStroke_Style);
324 SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width( )), 324 SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width( )),
325 SkIntToScalar(cache->info().width())); 325 SkIntToScalar(cache->info().width()));
326 canvas->drawRect(r, paint); 326 canvas->drawRect(r, paint);
327 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint); 327 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint);
328 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint); 328 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 372
373 private: 373 private:
374 typedef skiagm::GM INHERITED; 374 typedef skiagm::GM INHERITED;
375 }; 375 };
376 DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); ) 376 DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); )
377 DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); ) 377 DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); )
378 DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); ) 378 DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); )
379 #if SK_SUPPORT_GPU 379 #if SK_SUPPORT_GPU
380 DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); ) 380 DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); )
381 #endif 381 #endif
OLDNEW
« no previous file with comments | « gm/dcshader.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | src/gpu/SkGr.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698