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

Side by Side Diff: src/gpu/GrContextPriv.h

Issue 2211473002: Move GrContext::makeDrawContext to new GrContextPriv object (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix fragment Created 4 years, 4 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 | « src/gpu/GrContext.cpp ('k') | src/gpu/GrRenderTarget.cpp » ('j') | 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 * Copyright 2016 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrContextPriv_DEFINED
9 #define GrContextPriv_DEFINED
10
11 #include "GrContext.h"
12
13 /** Class that adds methods to GrContext that are only intended for use internal to Skia.
14 This class is purely a privileged window into GrContext. It should never hav e additional
15 data members or virtual methods. */
16 class GrContextPriv {
17 public:
18 // Create a drawContext that wraps an existing renderTarget
19 sk_sp<GrDrawContext> makeWrappedDrawContext(sk_sp<GrRenderTarget> rt,
20 sk_sp<SkColorSpace> colorSpace,
21 const SkSurfaceProps* = nullptr) ;
22
23 sk_sp<GrDrawContext> makeBackendTextureDrawContext(const GrBackendTextureDes c& desc,
24 sk_sp<SkColorSpace> color Space,
25 const SkSurfaceProps* = n ullptr,
26 GrWrapOwnership = kBorrow _GrWrapOwnership);
27
28 sk_sp<GrDrawContext> makeBackendRenderTargetDrawContext(const GrBackendRende rTargetDesc& desc,
29 sk_sp<SkColorSpace> colorSpace,
30 const SkSurfaceProps * = nullptr);
31
32 sk_sp<GrDrawContext> makeBackendTextureAsRenderTargetDrawContext(
33 const GrBackend TextureDesc& desc,
34 sk_sp<SkColorSp ace> colorSpace,
35 const SkSurface Props* = nullptr);
36
37 private:
38 explicit GrContextPriv(GrContext* context) : fContext(context) {}
39 GrContextPriv(const GrContextPriv&) {} // unimpl
40 GrContextPriv& operator=(const GrContextPriv&); // unimpl
41
42 // No taking addresses of this type.
43 const GrContextPriv* operator&() const;
44 GrContextPriv* operator&();
45
46 GrContext* fContext;
47
48 friend class GrContext; // to construct/copy this type.
49 };
50
51 inline GrContextPriv GrContext::contextPriv() { return GrContextPriv(this); }
52
53 inline const GrContextPriv GrContext::contextPriv () const {
54 return GrContextPriv(const_cast<GrContext*>(this));
55 }
56
57 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698