| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "skia/ext/benchmarking_canvas.h" | 8 #include "skia/ext/benchmarking_canvas.h" |
| 9 #include "third_party/skia/include/core/SkColorFilter.h" | 9 #include "third_party/skia/include/core/SkColorFilter.h" |
| 10 #include "third_party/skia/include/core/SkImageFilter.h" | 10 #include "third_party/skia/include/core/SkImageFilter.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 WARN_UNUSED_RESULT | 149 WARN_UNUSED_RESULT |
| 150 scoped_ptr<base::Value> AsValue(const SkColorFilter& filter) { | 150 scoped_ptr<base::Value> AsValue(const SkColorFilter& filter) { |
| 151 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); | 151 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); |
| 152 | 152 |
| 153 if (unsigned flags = filter.getFlags()) { | 153 if (unsigned flags = filter.getFlags()) { |
| 154 FlagsBuilder builder('|'); | 154 FlagsBuilder builder('|'); |
| 155 builder.addFlag(flags & SkColorFilter::kAlphaUnchanged_Flag, | 155 builder.addFlag(flags & SkColorFilter::kAlphaUnchanged_Flag, |
| 156 "kAlphaUnchanged_Flag"); | 156 "kAlphaUnchanged_Flag"); |
| 157 builder.addFlag(flags & SkColorFilter::kHasFilter16_Flag, | |
| 158 "kHasFilter16_Flag"); | |
| 159 | 157 |
| 160 val->SetString("flags", builder.str()); | 158 val->SetString("flags", builder.str()); |
| 161 } | 159 } |
| 162 | 160 |
| 163 SkScalar color_matrix[20]; | 161 SkScalar color_matrix[20]; |
| 164 if (filter.asColorMatrix(color_matrix)) { | 162 if (filter.asColorMatrix(color_matrix)) { |
| 165 scoped_ptr<base::ListValue> color_matrix_val(new base::ListValue()); | 163 scoped_ptr<base::ListValue> color_matrix_val(new base::ListValue()); |
| 166 for (unsigned i = 0; i < 20; ++i) | 164 for (unsigned i = 0; i < 20; ++i) |
| 167 color_matrix_val->Append(AsValue(color_matrix[i]).release()); | 165 color_matrix_val->Append(AsValue(color_matrix[i]).release()); |
| 168 | 166 |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 DCHECK(blob); | 811 DCHECK(blob); |
| 814 AutoOp op(this, "DrawTextBlob", &paint); | 812 AutoOp op(this, "DrawTextBlob", &paint); |
| 815 op.addParam("blob", AsValue(*blob)); | 813 op.addParam("blob", AsValue(*blob)); |
| 816 op.addParam("x", AsValue(x)); | 814 op.addParam("x", AsValue(x)); |
| 817 op.addParam("y", AsValue(y)); | 815 op.addParam("y", AsValue(y)); |
| 818 | 816 |
| 819 INHERITED::onDrawTextBlob(blob, x, y, *op.paint()); | 817 INHERITED::onDrawTextBlob(blob, x, y, *op.paint()); |
| 820 } | 818 } |
| 821 | 819 |
| 822 } // namespace skia | 820 } // namespace skia |
| OLD | NEW |