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

Side by Side Diff: tools/debugger/SkDrawCommand.cpp

Issue 2334123003: Add SkColor4f serialization (Closed)
Patch Set: Switched to memcpy, rebased Created 4 years, 2 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 | « tools/debugger/SkDrawCommand.h ('k') | tools/debugger/SkJsonWriteBuffer.h » ('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 "SkDrawCommand.h" 8 #include "SkDrawCommand.h"
9 9
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 Json::Value SkDrawCommand::MakeJsonColor(const SkColor color) { 422 Json::Value SkDrawCommand::MakeJsonColor(const SkColor color) {
423 Json::Value result(Json::arrayValue); 423 Json::Value result(Json::arrayValue);
424 result.append(Json::Value(SkColorGetA(color))); 424 result.append(Json::Value(SkColorGetA(color)));
425 result.append(Json::Value(SkColorGetR(color))); 425 result.append(Json::Value(SkColorGetR(color)));
426 result.append(Json::Value(SkColorGetG(color))); 426 result.append(Json::Value(SkColorGetG(color)));
427 result.append(Json::Value(SkColorGetB(color))); 427 result.append(Json::Value(SkColorGetB(color)));
428 return result; 428 return result;
429 } 429 }
430 430
431 Json::Value SkDrawCommand::MakeJsonColor4f(const SkColor4f& color) {
432 Json::Value result(Json::arrayValue);
433 result.append(Json::Value(color.fA));
434 result.append(Json::Value(color.fR));
435 result.append(Json::Value(color.fG));
436 result.append(Json::Value(color.fB));
437 return result;
438 }
439
431 Json::Value SkDrawCommand::MakeJsonPoint(const SkPoint& point) { 440 Json::Value SkDrawCommand::MakeJsonPoint(const SkPoint& point) {
432 Json::Value result(Json::arrayValue); 441 Json::Value result(Json::arrayValue);
433 result.append(Json::Value(point.x())); 442 result.append(Json::Value(point.x()));
434 result.append(Json::Value(point.y())); 443 result.append(Json::Value(point.y()));
435 return result; 444 return result;
436 } 445 }
437 446
438 Json::Value SkDrawCommand::MakeJsonPoint(SkScalar x, SkScalar y) { 447 Json::Value SkDrawCommand::MakeJsonPoint(SkScalar x, SkScalar y) {
439 Json::Value result(Json::arrayValue); 448 Json::Value result(Json::arrayValue);
440 result.append(Json::Value(x)); 449 result.append(Json::Value(x));
(...skipping 3106 matching lines...) Expand 10 before | Expand all | Expand 10 after
3547 SkTranslateZCommand* SkTranslateZCommand::fromJSON(Json::Value& command, 3556 SkTranslateZCommand* SkTranslateZCommand::fromJSON(Json::Value& command,
3548 UrlDataManager& urlDataManager) { 3557 UrlDataManager& urlDataManager) {
3549 SkScalar z; 3558 SkScalar z;
3550 #ifdef SK_EXPERIMENTAL_SHADOWING 3559 #ifdef SK_EXPERIMENTAL_SHADOWING
3551 extract_json_scalar(command[SKDEBUGCANVAS_ATTRIBUTE_DRAWDEPTHTRANS], &z); 3560 extract_json_scalar(command[SKDEBUGCANVAS_ATTRIBUTE_DRAWDEPTHTRANS], &z);
3552 #else 3561 #else
3553 z = 0; 3562 z = 0;
3554 #endif 3563 #endif
3555 return new SkTranslateZCommand(z); 3564 return new SkTranslateZCommand(z);
3556 } 3565 }
OLDNEW
« no previous file with comments | « tools/debugger/SkDrawCommand.h ('k') | tools/debugger/SkJsonWriteBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698