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

Side by Side Diff: tools/viewer/sk_app/WindowContext.h

Issue 2069653002: Use Offscreen Surface for Split Screen (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Better merge Created 4 years, 6 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 | « tools/viewer/sk_app/Window.cpp ('k') | tools/viewer/sk_app/WindowContext.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 2016 Google Inc. 2 * Copyright 2016 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 #ifndef WindowContext_DEFINED 7 #ifndef WindowContext_DEFINED
8 #define WindowContext_DEFINED 8 #define WindowContext_DEFINED
9 9
10 #include "DisplayParams.h" 10 #include "DisplayParams.h"
(...skipping 26 matching lines...) Expand all
37 virtual void setDisplayParams(const DisplayParams& params) = 0; 37 virtual void setDisplayParams(const DisplayParams& params) = 0;
38 38
39 SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; } 39 SkSurfaceProps getSurfaceProps() const { return fSurfaceProps; }
40 void setSurfaceProps(const SkSurfaceProps& props) { 40 void setSurfaceProps(const SkSurfaceProps& props) {
41 fSurfaceProps = props; 41 fSurfaceProps = props;
42 } 42 }
43 43
44 virtual GrBackendContext getBackendContext() = 0; 44 virtual GrBackendContext getBackendContext() = 0;
45 GrContext* getGrContext() const { return fContext; } 45 GrContext* getGrContext() const { return fContext; }
46 46
47 sk_sp<SkSurface> createOffscreenSurface(bool sRGB);
47 sk_sp<SkSurface> createRenderSurface(sk_sp<GrRenderTarget>, int colorBits); 48 sk_sp<SkSurface> createRenderSurface(sk_sp<GrRenderTarget>, int colorBits);
48 void presentRenderSurface(sk_sp<SkSurface> renderSurface, sk_sp<GrRenderTarg et> rt, 49 void presentRenderSurface(sk_sp<SkSurface> renderSurface, sk_sp<GrRenderTarg et> rt,
49 int colorBits); 50 int colorBits);
50 51
51 protected: 52 protected:
52 virtual bool isGpuContext() { return true; } 53 virtual bool isGpuContext() { return true; }
53 54
54 GrContext* fContext; 55 GrContext* fContext;
55 56
56 int fWidth; 57 int fWidth;
57 int fHeight; 58 int fHeight;
58 DisplayParams fDisplayParams; 59 DisplayParams fDisplayParams;
59 GrPixelConfig fPixelConfig; 60 GrPixelConfig fPixelConfig;
60 SkSurfaceProps fSurfaceProps; 61 SkSurfaceProps fSurfaceProps;
62
63 private:
64 sk_sp<SkSurface> createSurface(
65 sk_sp<GrRenderTarget>, int colorBits, bool offscreen, bool forceSRGB );
61 }; 66 };
62 67
63 } // namespace sk_app 68 } // namespace sk_app
64 69
65 #endif 70 #endif
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/Window.cpp ('k') | tools/viewer/sk_app/WindowContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698