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

Side by Side Diff: gm/discard.cpp

Issue 848903004: Require budget decision when creating a RenderTarget SkSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make compatible with chrome Created 5 years, 11 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/dftext.cpp ('k') | gm/image.cpp » ('j') | gm/xfermodes3.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "SkColorShader.h" 10 #include "SkColorShader.h"
(...skipping 28 matching lines...) Expand all
39 void onDraw(SkCanvas* canvas) SK_OVERRIDE { 39 void onDraw(SkCanvas* canvas) SK_OVERRIDE {
40 GrContext* context = canvas->getGrContext(); 40 GrContext* context = canvas->getGrContext();
41 if (NULL == context) { 41 if (NULL == context) {
42 return; 42 return;
43 } 43 }
44 44
45 SkISize size = this->getISize(); 45 SkISize size = this->getISize();
46 size.fWidth /= 10; 46 size.fWidth /= 10;
47 size.fHeight /= 10; 47 size.fHeight /= 10;
48 SkImageInfo info = SkImageInfo::MakeN32Premul(size); 48 SkImageInfo info = SkImageInfo::MakeN32Premul(size);
49 SkSurface* surface = SkSurface::NewRenderTarget(context, info); 49 SkSurface* surface = SkSurface::NewRenderTarget(context, SkSurface::kNo_ Budgeted, info);
50 50
51 if (NULL == surface) { 51 if (NULL == surface) {
52 return; 52 return;
53 } 53 }
54 54
55 canvas->clear(SK_ColorBLACK); 55 canvas->clear(SK_ColorBLACK);
56 56
57 SkRandom rand; 57 SkRandom rand;
58 for (int x = 0; x < 10; ++x) { 58 for (int x = 0; x < 10; ++x) {
59 for (int y = 0; y < 10; ++y) { 59 for (int y = 0; y < 10; ++y) {
(...skipping 26 matching lines...) Expand all
86 typedef GM INHERITED; 86 typedef GM INHERITED;
87 }; 87 };
88 88
89 ////////////////////////////////////////////////////////////////////////////// 89 //////////////////////////////////////////////////////////////////////////////
90 90
91 DEF_GM( return SkNEW(DiscardGM); ) 91 DEF_GM( return SkNEW(DiscardGM); )
92 92
93 } // end namespace 93 } // end namespace
94 94
95 #endif 95 #endif
OLDNEW
« no previous file with comments | « gm/dftext.cpp ('k') | gm/image.cpp » ('j') | gm/xfermodes3.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698