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

Side by Side Diff: dm/DMUtil.cpp

Issue 313613004: Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add staging entry point for Chromium and Android 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 | « no previous file | experimental/PdfViewer/SkNulCanvas.h » ('j') | include/core/SkCanvas.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMUtil.h" 1 #include "DMUtil.h"
2 2
3 #include "SkColorPriv.h" 3 #include "SkColorPriv.h"
4 #include "SkPicture.h" 4 #include "SkPicture.h"
5 #include "SkPictureRecorder.h" 5 #include "SkPictureRecorder.h"
6 6
7 namespace DM { 7 namespace DM {
8 8
9 SkString UnderJoin(const char* a, const char* b) { 9 SkString UnderJoin(const char* a, const char* b) {
10 SkString s; 10 SkString s;
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 void AllocatePixels(const SkBitmap& reference, SkBitmap* bitmap) { 30 void AllocatePixels(const SkBitmap& reference, SkBitmap* bitmap) {
31 AllocatePixels(reference.colorType(), reference.width(), reference.height(), bitmap); 31 AllocatePixels(reference.colorType(), reference.width(), reference.height(), bitmap);
32 } 32 }
33 33
34 void DrawPicture(SkPicture* picture, SkBitmap* bitmap) { 34 void DrawPicture(SkPicture* picture, SkBitmap* bitmap) {
35 SkASSERT(picture != NULL); 35 SkASSERT(picture != NULL);
36 SkASSERT(bitmap != NULL); 36 SkASSERT(bitmap != NULL);
37 SkCanvas canvas(*bitmap); 37 SkCanvas canvas(*bitmap);
38 canvas.drawPicture(*picture); 38 canvas.drawPicture(picture);
39 canvas.flush(); 39 canvas.flush();
40 } 40 }
41 41
42 static void unpack_565(uint16_t pixel, unsigned* r, unsigned* g, unsigned* b) { 42 static void unpack_565(uint16_t pixel, unsigned* r, unsigned* g, unsigned* b) {
43 *r = SkGetPackedR16(pixel); 43 *r = SkGetPackedR16(pixel);
44 *g = SkGetPackedG16(pixel); 44 *g = SkGetPackedG16(pixel);
45 *b = SkGetPackedB16(pixel); 45 *b = SkGetPackedB16(pixel);
46 } 46 }
47 47
48 // Returns |a-b|. 48 // Returns |a-b|.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 return max; 83 return max;
84 } 84 }
85 85
86 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b) { 86 bool BitmapsEqual(const SkBitmap& a, const SkBitmap& b) {
87 return a.info() == b.info() && 0 == MaxComponentDifference(a, b); 87 return a.info() == b.info() && 0 == MaxComponentDifference(a, b);
88 } 88 }
89 89
90 } // namespace DM 90 } // namespace DM
OLDNEW
« no previous file with comments | « no previous file | experimental/PdfViewer/SkNulCanvas.h » ('j') | include/core/SkCanvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698