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

Side by Side Diff: src/gpu/utils/GrUtils.cpp

Issue 73643005: Implement a benchmark for GrResourceCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address review 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
« src/gpu/utils/GrUtils.h ('K') | « src/gpu/utils/GrUtils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
2 /*
3 * Copyright 2013 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9 #if SK_SUPPORT_GPU
10
11 #include "GrContext.h"
12 #include "GrUtils.h"
13 #include "GrRenderTarget.h"
14 #include "SkCanvas.h"
15 #include "SkDevice.h"
16
17 // canvas could almost be a const&, but accessRenderTarget isn't const.
18 GrContext* GrUtils::GetGr(SkCanvas* canvas) {
19 SkASSERT(NULL != canvas);
20 SkBaseDevice* device = canvas->getTopDevice();
21 GrRenderTarget* renderTarget = device->accessRenderTarget();
22 if (NULL != renderTarget) {
23 return renderTarget->getContext();
24 }
25
26 return NULL;
27 }
28
29 #endif
OLDNEW
« src/gpu/utils/GrUtils.h ('K') | « src/gpu/utils/GrUtils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698