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

Side by Side Diff: gm/gm.cpp

Issue 73643005: Implement a benchmark for GrResourceCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address comments Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « gm/gm.h ('k') | gm/image.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 2011 Google Inc. 2 * Copyright 2011 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 using namespace skiagm; 9 using namespace skiagm;
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) { 57 void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) {
58 SkISize size = this->getISize(); 58 SkISize size = this->getISize();
59 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()), 59 SkRect r = SkRect::MakeWH(SkIntToScalar(size.width()),
60 SkIntToScalar(size.height())); 60 SkIntToScalar(size.height()));
61 SkPaint paint; 61 SkPaint paint;
62 paint.setColor(color); 62 paint.setColor(color);
63 canvas->drawRect(r, paint); 63 canvas->drawRect(r, paint);
64 } 64 }
65 65
66 #if SK_SUPPORT_GPU
67 // canvas could almost be a const&, but accessRenderTarget isn't const.
68 /*static*/ GrContext* GM::GetGr(SkCanvas* canvas) {
69 SkASSERT(NULL != canvas);
70 SkBaseDevice* device = canvas->getTopDevice();
71 GrRenderTarget* renderTarget = device->accessRenderTarget();
72 if (NULL != renderTarget) {
73 return renderTarget->getContext();
74 }
75 return NULL;
76 }
77 #endif
78
79 // need to explicitly declare this, or we get some weird infinite loop llist 66 // need to explicitly declare this, or we get some weird infinite loop llist
80 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead; 67 template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead;
OLDNEW
« no previous file with comments | « gm/gm.h ('k') | gm/image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698