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

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

Issue 551463004: introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add new file Created 6 years, 3 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/GrLayerHoister.cpp ('k') | src/gpu/SkGpuDevice.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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 10
(...skipping 25 matching lines...) Expand all
36 kCached_Flag = 1 << 1, //!< Surface is cached and needs to be unlock ed when released 36 kCached_Flag = 1 << 1, //!< Surface is cached and needs to be unlock ed when released
37 kDFFonts_Flag = 1 << 2, //!< Surface should render fonts using signed distance fields 37 kDFFonts_Flag = 1 << 2, //!< Surface should render fonts using signed distance fields
38 }; 38 };
39 39
40 /** 40 /**
41 * Creates an SkGpuDevice from a GrSurface. This will fail if the surface is not a render 41 * Creates an SkGpuDevice from a GrSurface. This will fail if the surface is not a render
42 * target. The caller owns a ref on the returned device. If the surface is c ached, 42 * target. The caller owns a ref on the returned device. If the surface is c ached,
43 * the kCached_Flag should be specified to make the device responsible for u nlocking 43 * the kCached_Flag should be specified to make the device responsible for u nlocking
44 * the surface when it is released. 44 * the surface when it is released.
45 */ 45 */
46 static SkGpuDevice* Create(GrSurface* surface, unsigned flags = 0); 46 static SkGpuDevice* Create(GrSurface* surface, const SkSurfaceProps&, unsign ed flags = 0);
47 47
48 /** 48 /**
49 * New device that will create an offscreen renderTarget based on the 49 * New device that will create an offscreen renderTarget based on the
50 * ImageInfo and sampleCount. The device's storage will not 50 * ImageInfo and sampleCount. The device's storage will not
51 * count against the GrContext's texture cache budget. The device's pixels 51 * count against the GrContext's texture cache budget. The device's pixels
52 * will be uninitialized. On failure, returns NULL. 52 * will be uninitialized. On failure, returns NULL.
53 */ 53 */
54 static SkGpuDevice* Create(GrContext*, const SkImageInfo&, int sampleCount); 54 static SkGpuDevice* Create(GrContext*, const SkImageInfo&, const SkSurfacePr ops&,
55 int sampleCount);
55 56
56 virtual ~SkGpuDevice(); 57 virtual ~SkGpuDevice();
57 58
58 GrContext* context() const { return fContext; } 59 GrContext* context() const { return fContext; }
59 60
60 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; 61 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE;
61 62
62 virtual SkImageInfo imageInfo() const SK_OVERRIDE { 63 virtual SkImageInfo imageInfo() const SK_OVERRIDE {
63 return fRenderTarget ? fRenderTarget->info() : SkImageInfo::MakeUnknown( ); 64 return fRenderTarget ? fRenderTarget->info() : SkImageInfo::MakeUnknown( );
64 } 65 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 GrTextContext* fMainTextContext; 139 GrTextContext* fMainTextContext;
139 GrTextContext* fFallbackTextContext; 140 GrTextContext* fFallbackTextContext;
140 141
141 // state for our render-target 142 // state for our render-target
142 GrRenderTarget* fRenderTarget; 143 GrRenderTarget* fRenderTarget;
143 bool fNeedClear; 144 bool fNeedClear;
144 145
145 // remove when our clients don't rely on accessBitmap() 146 // remove when our clients don't rely on accessBitmap()
146 SkBitmap fLegacyBitmap; 147 SkBitmap fLegacyBitmap;
147 148
148 SkGpuDevice(GrSurface*, unsigned flags = 0); 149 SkGpuDevice(GrSurface*, const SkSurfaceProps&, unsigned flags = 0);
149 150
150 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; 151 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE;
151 152
152 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; 153 virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_ OVERRIDE;
153 154
154 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE; 155 virtual SkImageFilter::Cache* getImageFilterCache() SK_OVERRIDE;
155 156
156 // temporarily change the return to false, until we understand the issues wi th filters and persp 157 // temporarily change the return to false, until we understand the issues wi th filters and persp
157 virtual bool forceConservativeRasterClip() const SK_OVERRIDE { return true; } 158 virtual bool forceConservativeRasterClip() const SK_OVERRIDE { return true; }
158 159
159 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t o override 160 // sets the render target, clip, and matrix on GrContext. Use forceIdenity t o override
160 // SkDraw's matrix and draw in device coords. 161 // SkDraw's matrix and draw in device coords.
161 void prepareDraw(const SkDraw&, bool forceIdentity); 162 void prepareDraw(const SkDraw&, bool forceIdentity);
162 163
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 bool bicubic); 200 bool bicubic);
200 201
201 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint); 202 bool drawDashLine(const SkPoint pts[2], const SkPaint& paint);
202 203
203 static SkPicture::AccelData::Key ComputeAccelDataKey(); 204 static SkPicture::AccelData::Key ComputeAccelDataKey();
204 205
205 typedef SkBaseDevice INHERITED; 206 typedef SkBaseDevice INHERITED;
206 }; 207 };
207 208
208 #endif 209 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrLayerHoister.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698