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

Side by Side Diff: gm/image_pict.cpp

Issue 2165703003: Adding an SkColorSpace to SkImage_Gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: s/NULL/nullptr/ Created 4 years, 5 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 | « no previous file | include/core/SkImage.h » ('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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width( )), 325 SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width( )),
326 SkIntToScalar(cache->info().width())); 326 SkIntToScalar(cache->info().width()));
327 canvas->drawRect(r, paint); 327 canvas->drawRect(r, paint);
328 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint); 328 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint);
329 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint); 329 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint);
330 return; 330 return;
331 } 331 }
332 // No API to draw a GrTexture directly, so we cheat and create a private image subclass 332 // No API to draw a GrTexture directly, so we cheat and create a private image subclass
333 SkAutoTUnref<SkImage> image(new SkImage_Gpu(cache->info().width(), cache ->info().height(), 333 SkAutoTUnref<SkImage> image(new SkImage_Gpu(cache->info().width(), cache ->info().height(),
334 cache->uniqueID(), kPremul_S kAlphaType, texture, 334 cache->uniqueID(), kPremul_S kAlphaType, texture,
335 sk_ref_sp(cache->info().colo rSpace()),
335 SkBudgeted::kNo)); 336 SkBudgeted::kNo));
336 canvas->drawImage(image, x, y); 337 canvas->drawImage(image, x, y);
337 #endif 338 #endif
338 } 339 }
339 340
340 void drawSet(SkCanvas* canvas) const { 341 void drawSet(SkCanvas* canvas) const {
341 SkMatrix matrix = SkMatrix::MakeTrans(-100, -100); 342 SkMatrix matrix = SkMatrix::MakeTrans(-100, -100);
342 canvas->drawPicture(fPicture, &matrix, nullptr); 343 canvas->drawPicture(fPicture, &matrix, nullptr);
343 344
344 // Draw the tex first, so it doesn't hit a lucky cache from the raster v ersion. This 345 // Draw the tex first, so it doesn't hit a lucky cache from the raster v ersion. This
(...skipping 28 matching lines...) Expand all
373 374
374 private: 375 private:
375 typedef skiagm::GM INHERITED; 376 typedef skiagm::GM INHERITED;
376 }; 377 };
377 DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); ) 378 DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); )
378 DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); ) 379 DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); )
379 DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); ) 380 DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); )
380 #if SK_SUPPORT_GPU 381 #if SK_SUPPORT_GPU
381 DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); ) 382 DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); )
382 #endif 383 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698