| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 WARN_UNUSED_RESULT | 301 WARN_UNUSED_RESULT |
| 302 scoped_ptr<base::Value> AsValue(const SkRegion& region) { | 302 scoped_ptr<base::Value> AsValue(const SkRegion& region) { |
| 303 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); | 303 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); |
| 304 val->Set("bounds", AsValue(SkRect::Make(region.getBounds()))); | 304 val->Set("bounds", AsValue(SkRect::Make(region.getBounds()))); |
| 305 | 305 |
| 306 return val.Pass(); | 306 return val.Pass(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 WARN_UNUSED_RESULT | 309 WARN_UNUSED_RESULT |
| 310 scoped_ptr<base::Value> AsValue(const SkPicture& picture) { | |
| 311 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); | |
| 312 val->Set("cull-rect", AsValue(picture.cullRect())); | |
| 313 | |
| 314 return val.Pass(); | |
| 315 } | |
| 316 | |
| 317 WARN_UNUSED_RESULT | |
| 318 scoped_ptr<base::Value> AsValue(const SkBitmap& bitmap) { | 310 scoped_ptr<base::Value> AsValue(const SkBitmap& bitmap) { |
| 319 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); | 311 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); |
| 320 val->Set("size", AsValue(SkSize::Make(bitmap.width(), bitmap.height()))); | 312 val->Set("size", AsValue(SkSize::Make(bitmap.width(), bitmap.height()))); |
| 321 | 313 |
| 322 return val.Pass(); | 314 return val.Pass(); |
| 323 } | 315 } |
| 324 | 316 |
| 325 WARN_UNUSED_RESULT | 317 WARN_UNUSED_RESULT |
| 326 scoped_ptr<base::Value> AsValue(const SkImage& image) { | 318 scoped_ptr<base::Value> AsValue(const SkImage& image) { |
| 327 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); | 319 scoped_ptr<base::DictionaryValue> val(new base::DictionaryValue()); |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 DCHECK(blob); | 804 DCHECK(blob); |
| 813 AutoOp op(this, "DrawTextBlob", &paint); | 805 AutoOp op(this, "DrawTextBlob", &paint); |
| 814 op.addParam("blob", AsValue(*blob)); | 806 op.addParam("blob", AsValue(*blob)); |
| 815 op.addParam("x", AsValue(x)); | 807 op.addParam("x", AsValue(x)); |
| 816 op.addParam("y", AsValue(y)); | 808 op.addParam("y", AsValue(y)); |
| 817 | 809 |
| 818 INHERITED::onDrawTextBlob(blob, x, y, *op.paint()); | 810 INHERITED::onDrawTextBlob(blob, x, y, *op.paint()); |
| 819 } | 811 } |
| 820 | 812 |
| 821 } // namespace skia | 813 } // namespace skia |
| OLD | NEW |