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

Side by Side Diff: gm/image_shader.cpp

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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/imagetoyuvplanes.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 "SkData.h" 10 #include "SkData.h"
(...skipping 19 matching lines...) Expand all
30 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info)); 30 SkAutoTUnref<SkSurface> surface(SkSurface::NewRaster(info));
31 surface->getCanvas()->clear(0); 31 surface->getCanvas()->clear(0);
32 surface->getCanvas()->drawPicture(pic); 32 surface->getCanvas()->drawPicture(pic);
33 return surface->newImageSnapshot(); 33 return surface->newImageSnapshot();
34 } 34 }
35 35
36 static SkImage* make_texture(GrContext* ctx, const SkPicture* pic, const SkImage Info& info) { 36 static SkImage* make_texture(GrContext* ctx, const SkPicture* pic, const SkImage Info& info) {
37 if (!ctx) { 37 if (!ctx) {
38 return nullptr; 38 return nullptr;
39 } 39 }
40 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(ctx, SkBudgeted:: kNo, 40 SkAutoTUnref<SkSurface> surface(SkSurface::NewRenderTarget(ctx, SkSurface::k No_Budgeted,
41 info, 0)); 41 info, 0));
42 surface->getCanvas()->clear(0); 42 surface->getCanvas()->clear(0);
43 surface->getCanvas()->drawPicture(pic); 43 surface->getCanvas()->drawPicture(pic);
44 return surface->newImageSnapshot(); 44 return surface->newImageSnapshot();
45 } 45 }
46 46
47 static SkImage* make_pict_gen(GrContext*, const SkPicture* pic, const SkImageInf o& info) { 47 static SkImage* make_pict_gen(GrContext*, const SkPicture* pic, const SkImageInf o& info) {
48 return SkImage::NewFromPicture(pic, info.dimensions(), nullptr, nullptr); 48 return SkImage::NewFromPicture(pic, info.dimensions(), nullptr, nullptr);
49 } 49 }
50 50
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 canvas->translate(120, 0); 121 canvas->translate(120, 0);
122 } 122 }
123 } 123 }
124 124
125 private: 125 private:
126 typedef skiagm::GM INHERITED; 126 typedef skiagm::GM INHERITED;
127 }; 127 };
128 DEF_GM( return new ImageShaderGM; ) 128 DEF_GM( return new ImageShaderGM; )
129 129
OLDNEW
« no previous file with comments | « gm/image_pict.cpp ('k') | gm/imagetoyuvplanes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698