| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "cc/resources/picture.h" | 5 #include "cc/resources/picture.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/base64.h" | 11 #include "base/base64.h" |
| 12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
| 13 #include "base/debug/trace_event_argument.h" | 13 #include "base/debug/trace_event_argument.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "cc/base/math_util.h" | 15 #include "cc/base/math_util.h" |
| 16 #include "cc/base/util.h" | 16 #include "cc/base/util.h" |
| 17 #include "cc/debug/traced_picture.h" | 17 #include "cc/debug/traced_picture.h" |
| 18 #include "cc/debug/traced_value.h" | 18 #include "cc/debug/traced_value.h" |
| 19 #include "cc/layers/content_layer_client.h" | 19 #include "cc/layers/content_layer_client.h" |
| 20 #include "skia/ext/pixel_ref_utils.h" | 20 #include "skia/ext/pixel_ref_utils.h" |
| 21 #include "third_party/skia/include/core/SkBBHFactory.h" |
| 21 #include "third_party/skia/include/core/SkCanvas.h" | 22 #include "third_party/skia/include/core/SkCanvas.h" |
| 22 #include "third_party/skia/include/core/SkData.h" | 23 #include "third_party/skia/include/core/SkData.h" |
| 23 #include "third_party/skia/include/core/SkDrawFilter.h" | |
| 24 #include "third_party/skia/include/core/SkPaint.h" | 24 #include "third_party/skia/include/core/SkPaint.h" |
| 25 #include "third_party/skia/include/core/SkPictureRecorder.h" | 25 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 26 #include "third_party/skia/include/core/SkStream.h" | 26 #include "third_party/skia/include/core/SkStream.h" |
| 27 #include "third_party/skia/include/utils/SkNullCanvas.h" | 27 #include "third_party/skia/include/utils/SkNullCanvas.h" |
| 28 #include "third_party/skia/include/utils/SkPictureUtils.h" | |
| 29 #include "ui/gfx/codec/jpeg_codec.h" | 28 #include "ui/gfx/codec/jpeg_codec.h" |
| 30 #include "ui/gfx/codec/png_codec.h" | 29 #include "ui/gfx/codec/png_codec.h" |
| 31 #include "ui/gfx/rect_conversions.h" | 30 #include "ui/gfx/geometry/rect_conversions.h" |
| 32 #include "ui/gfx/skia_util.h" | 31 #include "ui/gfx/skia_util.h" |
| 33 | 32 |
| 34 namespace cc { | 33 namespace cc { |
| 35 | 34 |
| 36 namespace { | 35 namespace { |
| 37 | 36 |
| 38 SkData* EncodeBitmap(size_t* offset, const SkBitmap& bm) { | 37 SkData* EncodeBitmap(size_t* offset, const SkBitmap& bm) { |
| 39 const int kJpegQuality = 80; | 38 const int kJpegQuality = 80; |
| 40 std::vector<unsigned char> data; | 39 std::vector<unsigned char> data; |
| 41 | 40 |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 scoped_refptr<base::debug::TracedValue> record_data = | 511 scoped_refptr<base::debug::TracedValue> record_data = |
| 513 new base::debug::TracedValue(); | 512 new base::debug::TracedValue(); |
| 514 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); | 513 TracedValue::SetIDRef(this, record_data.get(), "picture_id"); |
| 515 record_data->BeginArray("layer_rect"); | 514 record_data->BeginArray("layer_rect"); |
| 516 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); | 515 MathUtil::AddToTracedValue(layer_rect_, record_data.get()); |
| 517 record_data->EndArray(); | 516 record_data->EndArray(); |
| 518 return record_data; | 517 return record_data; |
| 519 } | 518 } |
| 520 | 519 |
| 521 } // namespace cc | 520 } // namespace cc |
| OLD | NEW |