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

Side by Side Diff: src/utils/SkPictureUtils.cpp

Issue 132293002: Expand GatherPixelRefs unit test (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: clean up Created 6 years, 11 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 | « no previous file | tests/PictureTest.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 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 7
8 #include "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 virtual void drawOval(const SkDraw&, const SkRect&, 105 virtual void drawOval(const SkDraw&, const SkRect&,
106 const SkPaint& paint) SK_OVERRIDE { 106 const SkPaint& paint) SK_OVERRIDE {
107 this->addBitmapFromPaint(paint); 107 this->addBitmapFromPaint(paint);
108 } 108 }
109 virtual void drawPath(const SkDraw&, const SkPath& path, 109 virtual void drawPath(const SkDraw&, const SkPath& path,
110 const SkPaint& paint, const SkMatrix* prePathMatrix, 110 const SkPaint& paint, const SkMatrix* prePathMatrix,
111 bool pathIsMutable) SK_OVERRIDE { 111 bool pathIsMutable) SK_OVERRIDE {
112 this->addBitmapFromPaint(paint); 112 this->addBitmapFromPaint(paint);
113 } 113 }
114 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap, 114 virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap,
115 const SkMatrix&, const SkPaint&) SK_OVERRIDE { 115 const SkMatrix&, const SkPaint& paint) SK_OVERRIDE {
116 this->addBitmap(bitmap); 116 this->addBitmap(bitmap);
117 if (SkBitmap::kA8_Config == bitmap.config()) {
118 this->addBitmapFromPaint(paint);
119 }
117 } 120 }
118 virtual void drawBitmapRect(const SkDraw&, const SkBitmap& bitmap, 121 virtual void drawBitmapRect(const SkDraw&, const SkBitmap& bitmap,
119 const SkRect* srcOrNull, const SkRect& dst, 122 const SkRect* srcOrNull, const SkRect& dst,
120 const SkPaint&, 123 const SkPaint& paint,
121 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE { 124 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE {
122 this->addBitmap(bitmap); 125 this->addBitmap(bitmap);
126 if (SkBitmap::kA8_Config == bitmap.config()) {
127 this->addBitmapFromPaint(paint);
128 }
123 } 129 }
124 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap, 130 virtual void drawSprite(const SkDraw&, const SkBitmap& bitmap,
125 int x, int y, const SkPaint& paint) SK_OVERRIDE { 131 int x, int y, const SkPaint& paint) SK_OVERRIDE {
126 this->addBitmap(bitmap); 132 this->addBitmap(bitmap);
127 } 133 }
128 virtual void drawText(const SkDraw&, const void* text, size_t len, 134 virtual void drawText(const SkDraw&, const void* text, size_t len,
129 SkScalar x, SkScalar y, 135 SkScalar x, SkScalar y,
130 const SkPaint& paint) SK_OVERRIDE { 136 const SkPaint& paint) SK_OVERRIDE {
131 this->addBitmapFromPaint(paint); 137 this->addBitmapFromPaint(paint);
132 } 138 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 canvas.clipRect(area, SkRegion::kIntersect_Op, false); 265 canvas.clipRect(area, SkRegion::kIntersect_Op, false);
260 canvas.drawPicture(*pict); 266 canvas.drawPicture(*pict);
261 267
262 SkData* data = NULL; 268 SkData* data = NULL;
263 int count = array.count(); 269 int count = array.count();
264 if (count > 0) { 270 if (count > 0) {
265 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) ); 271 data = SkData::NewFromMalloc(array.detach(), count * sizeof(SkPixelRef*) );
266 } 272 }
267 return data; 273 return data;
268 } 274 }
OLDNEW
« no previous file with comments | « no previous file | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698