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

Side by Side Diff: Source/platform/graphics/GraphicsContextRecorder.cpp

Issue 316863003: Switch Blink to using new Skia SkCanvas::drawPicture method (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address code review comment (fix override in GraphicsContextRecorder) 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 | « Source/platform/graphics/GraphicsContext.cpp ('k') | no next file » | 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 (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } 195 }
196 196
197 void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkP aint& paint) OVERRIDE 197 void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkP aint& paint) OVERRIDE
198 { 198 {
199 RefPtr<JSONObject> params = addItemWithParams("drawPoints"); 199 RefPtr<JSONObject> params = addItemWithParams("drawPoints");
200 params->setString("pointMode", pointModeName(mode)); 200 params->setString("pointMode", pointModeName(mode));
201 params->setArray("points", arrayForSkPoints(count, pts)); 201 params->setArray("points", arrayForSkPoints(count, pts));
202 params->setObject("paint", objectForSkPaint(paint)); 202 params->setObject("paint", objectForSkPaint(paint));
203 } 203 }
204 204
205 void drawPicture(SkPicture& picture) OVERRIDE
206 {
207 addItemWithParams("drawPicture")->setObject("picture", objectForSkPictur e(picture));
208 }
209
210 void drawRect(const SkRect& rect, const SkPaint& paint) OVERRIDE 205 void drawRect(const SkRect& rect, const SkPaint& paint) OVERRIDE
211 { 206 {
212 RefPtr<JSONObject> params = addItemWithParams("drawRect"); 207 RefPtr<JSONObject> params = addItemWithParams("drawRect");
213 params->setObject("rect", objectForSkRect(rect)); 208 params->setObject("rect", objectForSkRect(rect));
214 params->setObject("paint", objectForSkPaint(paint)); 209 params->setObject("paint", objectForSkPaint(paint));
215 } 210 }
216 211
217 void drawOval(const SkRect& oval, const SkPaint& paint) OVERRIDE 212 void drawOval(const SkRect& oval, const SkPaint& paint) OVERRIDE
218 { 213 {
219 RefPtr<JSONObject> params = addItemWithParams("drawOval"); 214 RefPtr<JSONObject> params = addItemWithParams("drawOval");
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 params->setString("SkRegion::Op", regionOpName(op)); 385 params->setString("SkRegion::Op", regionOpName(op));
391 params->setBoolean("softClipEdgeStyle", kSoft_ClipEdgeStyle == style); 386 params->setBoolean("softClipEdgeStyle", kSoft_ClipEdgeStyle == style);
392 } 387 }
393 388
394 void onClipRegion(const SkRegion& region, SkRegion::Op op) OVERRIDE 389 void onClipRegion(const SkRegion& region, SkRegion::Op op) OVERRIDE
395 { 390 {
396 RefPtr<JSONObject> params = addItemWithParams("clipRegion"); 391 RefPtr<JSONObject> params = addItemWithParams("clipRegion");
397 params->setString("op", regionOpName(op)); 392 params->setString("op", regionOpName(op));
398 } 393 }
399 394
395 void onDrawPicture(const SkPicture* picture) OVERRIDE
396 {
397 addItemWithParams("drawPicture")->setObject("picture", objectForSkPictur e(*picture));
398 }
399
400 void didSetMatrix(const SkMatrix& matrix) OVERRIDE 400 void didSetMatrix(const SkMatrix& matrix) OVERRIDE
401 { 401 {
402 RefPtr<JSONObject> params = addItemWithParams("setMatrix"); 402 RefPtr<JSONObject> params = addItemWithParams("setMatrix");
403 params->setArray("matrix", arrayForSkMatrix(matrix)); 403 params->setArray("matrix", arrayForSkMatrix(matrix));
404 this->SkCanvas::didSetMatrix(matrix); 404 this->SkCanvas::didSetMatrix(matrix);
405 } 405 }
406 406
407 void didConcat(const SkMatrix& matrix) OVERRIDE 407 void didConcat(const SkMatrix& matrix) OVERRIDE
408 { 408 {
409 switch (matrix.getType()) { 409 switch (matrix.getType()) {
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 1035
1036 PassRefPtr<JSONArray> GraphicsContextSnapshot::snapshotCommandLog() const 1036 PassRefPtr<JSONArray> GraphicsContextSnapshot::snapshotCommandLog() const
1037 { 1037 {
1038 LoggingCanvas canvas; 1038 LoggingCanvas canvas;
1039 FragmentSnapshotPlayer player(m_picture, &canvas); 1039 FragmentSnapshotPlayer player(m_picture, &canvas);
1040 player.play(0, 0); 1040 player.play(0, 0);
1041 return canvas.log(); 1041 return canvas.log();
1042 } 1042 }
1043 1043
1044 } 1044 }
OLDNEW
« no previous file with comments | « Source/platform/graphics/GraphicsContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698