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

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

Issue 73643005: Implement a benchmark for GrResourceCache (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address comments Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « gyp/bench.gypi ('k') | src/core/SkCanvas.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 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 #ifndef SkCanvas_DEFINED 10 #ifndef SkCanvas_DEFINED
(...skipping 11 matching lines...) Expand all
22 #include "SkXfermode.h" 22 #include "SkXfermode.h"
23 23
24 class SkBounder; 24 class SkBounder;
25 class SkBaseDevice; 25 class SkBaseDevice;
26 class SkDraw; 26 class SkDraw;
27 class SkDrawFilter; 27 class SkDrawFilter;
28 class SkMetaData; 28 class SkMetaData;
29 class SkPicture; 29 class SkPicture;
30 class SkRRect; 30 class SkRRect;
31 class SkSurface_Base; 31 class SkSurface_Base;
32 class GrContext;
32 33
33 /** \class SkCanvas 34 /** \class SkCanvas
34 35
35 A Canvas encapsulates all of the state about drawing into a device (bitmap). 36 A Canvas encapsulates all of the state about drawing into a device (bitmap).
36 This includes a reference to the device itself, and a stack of matrix/clip 37 This includes a reference to the device itself, and a stack of matrix/clip
37 values. For any given draw call (e.g. drawRect), the geometry of the object 38 values. For any given draw call (e.g. drawRect), the geometry of the object
38 being drawn is transformed by the concatenation of all the matrices in the 39 being drawn is transformed by the concatenation of all the matrices in the
39 stack. The transformed geometry is clipped by the intersection of all of 40 stack. The transformed geometry is clipped by the intersection of all of
40 the clips in the stack. 41 the clips in the stack.
41 42
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 SkBaseDevice* getTopDevice(bool updateMatrixClip = false) const; 103 SkBaseDevice* getTopDevice(bool updateMatrixClip = false) const;
103 104
104 /** 105 /**
105 * Shortcut for getDevice()->createCompatibleDevice(...). 106 * Shortcut for getDevice()->createCompatibleDevice(...).
106 * If getDevice() == NULL, this method does nothing, and returns NULL. 107 * If getDevice() == NULL, this method does nothing, and returns NULL.
107 */ 108 */
108 SkBaseDevice* createCompatibleDevice(SkBitmap::Config config, 109 SkBaseDevice* createCompatibleDevice(SkBitmap::Config config,
109 int width, int height, 110 int width, int height,
110 bool isOpaque); 111 bool isOpaque);
111 112
113 /**
114 * Return the GPU context of the device that is associated with the canvas.
115 * For a canvas with non-GPU device, NULL is returned.
116 */
117 GrContext* getGrContext();
118
112 /////////////////////////////////////////////////////////////////////////// 119 ///////////////////////////////////////////////////////////////////////////
113 120
114 /** 121 /**
115 * This enum can be used with read/writePixels to perform a pixel ops to or 122 * This enum can be used with read/writePixels to perform a pixel ops to or
116 * from an 8888 config other than Skia's native config (SkPMColor). There 123 * from an 8888 config other than Skia's native config (SkPMColor). There
117 * are three byte orders supported: native, BGRA, and RGBA. Each has a 124 * are three byte orders supported: native, BGRA, and RGBA. Each has a
118 * premultiplied and unpremultiplied variant. 125 * premultiplied and unpremultiplied variant.
119 * 126 *
120 * Components of a 8888 pixel can be packed/unpacked from a 32bit word using 127 * Components of a 8888 pixel can be packed/unpacked from a 32bit word using
121 * either byte offsets or shift values. Byte offsets are endian-invariant 128 * either byte offsets or shift values. Byte offsets are endian-invariant
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1176 fCanvas->endCommentGroup(); 1183 fCanvas->endCommentGroup();
1177 } 1184 }
1178 } 1185 }
1179 1186
1180 private: 1187 private:
1181 SkCanvas* fCanvas; 1188 SkCanvas* fCanvas;
1182 }; 1189 };
1183 #define SkAutoCommentBlock(...) SK_REQUIRE_LOCAL_VAR(SkAutoCommentBlock) 1190 #define SkAutoCommentBlock(...) SK_REQUIRE_LOCAL_VAR(SkAutoCommentBlock)
1184 1191
1185 #endif 1192 #endif
OLDNEW
« no previous file with comments | « gyp/bench.gypi ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698