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

Side by Side Diff: include/core/SkBitmapDevice.h

Issue 334993002: hide virtuals on device for width/height/isopaque (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « gyp/skia_for_chromium_defines.gypi ('k') | include/core/SkDevice.h » ('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 2013 Google Inc. 3 * Copyright 2013 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 #ifndef SkBitmapDevice_DEFINED 9 #ifndef SkBitmapDevice_DEFINED
10 #define SkBitmapDevice_DEFINED 10 #define SkBitmapDevice_DEFINED
(...skipping 15 matching lines...) Expand all
26 /** 26 /**
27 * Construct a new device with the specified bitmap as its backend. It is 27 * Construct a new device with the specified bitmap as its backend. It is
28 * valid for the bitmap to have no pixels associated with it. In that case, 28 * valid for the bitmap to have no pixels associated with it. In that case,
29 * any drawing to this device will have no effect. 29 * any drawing to this device will have no effect.
30 */ 30 */
31 SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties& devicePrope rties); 31 SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties& devicePrope rties);
32 32
33 static SkBitmapDevice* Create(const SkImageInfo&, 33 static SkBitmapDevice* Create(const SkImageInfo&,
34 const SkDeviceProperties* = NULL); 34 const SkDeviceProperties* = NULL);
35 35
36 /** Return the width of the device (in pixels).
37 */
38 virtual int width() const SK_OVERRIDE { return fBitmap.width(); }
39 /** Return the height of the device (in pixels).
40 */
41 virtual int height() const SK_OVERRIDE { return fBitmap.height(); }
42
43 /** Returns true if the device's bitmap's config treats every pixels as
44 implicitly opaque.
45 */
46 virtual bool isOpaque() const SK_OVERRIDE { return fBitmap.isOpaque(); }
47
48 virtual SkImageInfo imageInfo() const SK_OVERRIDE; 36 virtual SkImageInfo imageInfo() const SK_OVERRIDE;
49 37
50 /** 38 /**
51 * Return the device's associated gpu render target, or NULL. 39 * Return the device's associated gpu render target, or NULL.
52 */ 40 */
53 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; } 41 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; }
54 42
55 protected: 43 protected:
56 /** 44 /**
57 * Device may filter the text flags for drawing text here. If it wants to 45 * Device may filter the text flags for drawing text here. If it wants to
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 199
212 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; 200 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE;
213 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; 201 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE;
214 202
215 SkBitmap fBitmap; 203 SkBitmap fBitmap;
216 204
217 typedef SkBaseDevice INHERITED; 205 typedef SkBaseDevice INHERITED;
218 }; 206 };
219 207
220 #endif // SkBitmapDevice_DEFINED 208 #endif // SkBitmapDevice_DEFINED
OLDNEW
« no previous file with comments | « gyp/skia_for_chromium_defines.gypi ('k') | include/core/SkDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698