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

Side by Side Diff: gm/image_pict.cpp

Issue 1364443002: remove unused (by the outside) SkImage::newSurface, and simplify newImage -> newSubset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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.cpp ('k') | gm/surface.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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width( )), 319 SkRect r = SkRect::MakeXYWH(x, y, SkIntToScalar(cache->info().width( )),
320 SkIntToScalar(cache->info().width())); 320 SkIntToScalar(cache->info().width()));
321 canvas->drawRect(r, paint); 321 canvas->drawRect(r, paint);
322 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint); 322 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint);
323 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint); 323 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint);
324 return; 324 return;
325 } 325 }
326 // No API to draw a GrTexture directly, so we cheat and create a private image subclass 326 // No API to draw a GrTexture directly, so we cheat and create a private image subclass
327 SkAutoTUnref<SkImage> image(new SkImage_Gpu(cache->info().width(), cache ->info().height(), 327 SkAutoTUnref<SkImage> image(new SkImage_Gpu(cache->info().width(), cache ->info().height(),
328 cache->uniqueID(), kPremul_S kAlphaType, texture, 328 cache->uniqueID(), kPremul_S kAlphaType, texture,
329 0, SkSurface::kNo_Budgeted)) ; 329 SkSurface::kNo_Budgeted));
330 canvas->drawImage(image, x, y); 330 canvas->drawImage(image, x, y);
331 #endif 331 #endif
332 } 332 }
333 333
334 void drawSet(SkCanvas* canvas) const { 334 void drawSet(SkCanvas* canvas) const {
335 SkMatrix matrix = SkMatrix::MakeTrans(-100, -100); 335 SkMatrix matrix = SkMatrix::MakeTrans(-100, -100);
336 canvas->drawPicture(fPicture, &matrix, nullptr); 336 canvas->drawPicture(fPicture, &matrix, nullptr);
337 337
338 // Draw the tex first, so it doesn't hit a lucky cache from the raster v ersion. This 338 // Draw the tex first, so it doesn't hit a lucky cache from the raster v ersion. This
339 // way we also can force the generateTexture call. 339 // way we also can force the generateTexture call.
(...skipping 30 matching lines...) Expand all
370 }; 370 };
371 DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); ) 371 DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); )
372 DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); ) 372 DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); )
373 DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); ) 373 DEF_GM( return new ImageCacheratorGM("ctable", make_ctable_generator); )
374 #if SK_SUPPORT_GPU 374 #if SK_SUPPORT_GPU
375 DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); ) 375 DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); )
376 #endif 376 #endif
377 377
378 378
379 379
OLDNEW
« no previous file with comments | « gm/image.cpp ('k') | gm/surface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698