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

Side by Side Diff: skia/gl/SkGLDevice_SWLayer.cpp

Issue 113827: Remove the remainder of the skia source code from the Chromium repo.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « skia/gl/SkGLDevice_SWLayer.h ('k') | skia/gl/SkGLTextCache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "SkGLDevice_SWLayer.h"
2 #include "SkRegion.h"
3
4 SkGLDevice_SWLayer::SkGLDevice_SWLayer(const SkBitmap& bitmap)
5 : SkGLDevice(bitmap, true) {
6 fTextureID = 0;
7
8 SkASSERT(bitmap.getPixels());
9 }
10
11 SkGLDevice_SWLayer::~SkGLDevice_SWLayer() {
12 if (fTextureID) {
13 glDeleteTextures(1, &fTextureID);
14 }
15 }
16
17 SkGLDevice::TexOrientation SkGLDevice_SWLayer::bindDeviceAsTexture() {
18 const SkBitmap& bitmap = this->accessBitmap(false);
19
20 if (0 == fTextureID) {
21 fTextureID = SkGL::BindNewTexture(bitmap, NULL);
22 }
23 return kTopToBottom_TexOrientation;
24 }
25
26 ///////////////////////////////////////////////////////////////////////////////
27
28 #include "SkDraw.h"
29
30 void SkGLDevice_SWLayer::drawPaint(const SkDraw& draw, const SkPaint& paint) {
31 draw.drawPaint(paint);
32 }
33
34 void SkGLDevice_SWLayer::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode , size_t count,
35 const SkPoint pts[], const SkPaint& paint) {
36 draw.drawPoints(mode, count, pts, paint);
37 }
38
39 void SkGLDevice_SWLayer::drawRect(const SkDraw& draw, const SkRect& r,
40 const SkPaint& paint) {
41 draw.drawRect(r, paint);
42 }
43
44 void SkGLDevice_SWLayer::drawPath(const SkDraw& draw, const SkPath& path,
45 const SkPaint& paint) {
46 draw.drawPath(path, paint);
47 }
48
49 void SkGLDevice_SWLayer::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap,
50 const SkMatrix& matrix, const SkPaint& paint) {
51 draw.drawBitmap(bitmap, matrix, paint);
52 }
53
54 void SkGLDevice_SWLayer::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
55 int x, int y, const SkPaint& paint) {
56 draw.drawSprite(bitmap, x, y, paint);
57 }
58
59 void SkGLDevice_SWLayer::drawText(const SkDraw& draw, const void* text, size_t l en,
60 SkScalar x, SkScalar y, const SkPaint& paint) {
61 draw.drawText((const char*)text, len, x, y, paint);
62 }
63
64 void SkGLDevice_SWLayer::drawPosText(const SkDraw& draw, const void* text, size_ t len,
65 const SkScalar xpos[], SkScalar y,
66 int scalarsPerPos, const SkPaint& paint) {
67 draw.drawPosText((const char*)text, len, xpos, y, scalarsPerPos, paint);
68 }
69
70 void SkGLDevice_SWLayer::drawTextOnPath(const SkDraw& draw, const void* text,
71 size_t len, const SkPath& path,
72 const SkMatrix* matrix,
73 const SkPaint& paint) {
74 draw.drawTextOnPath((const char*)text, len, path, matrix, paint);
75 }
76
77 void SkGLDevice_SWLayer::drawVertices(const SkDraw& draw, SkCanvas::VertexMode v mode,
78 int vertexCount,
79 const SkPoint verts[], const SkPoint textures[],
80 const SkColor colors[], SkXfermode* xmode,
81 const uint16_t indices[], int indexCount,
82 const SkPaint& paint) {
83 draw.drawVertices(vmode, vertexCount, verts, textures, colors, xmode,
84 indices, indexCount, paint);
85 }
86
87 void SkGLDevice_SWLayer::drawDevice(const SkDraw& draw, SkDevice* dev,
88 int x, int y, const SkPaint& paint) {
89 this->SkDevice::drawDevice(draw, dev, x, y, paint);
90 }
91
OLDNEW
« no previous file with comments | « skia/gl/SkGLDevice_SWLayer.h ('k') | skia/gl/SkGLTextCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698