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

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

Issue 2165703002: Make sk_app::WindowContext directly create a SkSurface without an intermediate GrRenderTarget (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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
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 27 matching lines...) Expand all
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> createOffscreenSurface(bool sRGB);
48 sk_sp<SkSurface> createRenderSurface(sk_sp<GrRenderTarget>, int colorBits);
49 void presentRenderSurface(sk_sp<SkSurface> renderSurface, sk_sp<GrRenderTarg et> rt, 48 void presentRenderSurface(sk_sp<SkSurface> renderSurface, sk_sp<GrRenderTarg et> rt,
50 int colorBits); 49 int colorBits);
51 50
52 protected: 51 protected:
53 virtual bool isGpuContext() { return true; } 52 virtual bool isGpuContext() { return true; }
54 53
54 sk_sp<SkSurface> createRenderSurface(GrBackendRenderTargetDesc, int colorBit s);
Brian Osman 2016/07/19 16:08:18 Pass the desc by const& in both places? (Why is it
bsalomon 2016/07/19 16:19:17 It's required for this function and optional for t
55
55 GrContext* fContext; 56 GrContext* fContext;
56 57
57 int fWidth; 58 int fWidth;
58 int fHeight; 59 int fHeight;
59 DisplayParams fDisplayParams; 60 DisplayParams fDisplayParams;
60 GrPixelConfig fPixelConfig; 61 GrPixelConfig fPixelConfig;
61 SkSurfaceProps fSurfaceProps; 62 SkSurfaceProps fSurfaceProps;
62 63
63 private: 64 private:
64 sk_sp<SkSurface> createSurface( 65 sk_sp<SkSurface> createSurface(
65 sk_sp<GrRenderTarget>, int colorBits, bool offscreen, bool forceSRGB ); 66 GrBackendRenderTargetDesc*, int colorBits, bool offscreen, bool forc eSRGB);
66 }; 67 };
67 68
68 } // namespace sk_app 69 } // namespace sk_app
69 70
70 #endif 71 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698