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 "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
6 #include "cc/debug/rendering_stats.h" | 6 #include "cc/debug/rendering_stats.h" |
7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
8 #include "cc/resources/picture.h" | 8 #include "cc/resources/picture.h" |
9 #include "skia/ext/analysis_canvas.h" | 9 #include "skia/ext/analysis_canvas.h" |
10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 public: | 23 public: |
24 // SkDrawFilter interface. | 24 // SkDrawFilter interface. |
25 virtual bool filter(SkPaint* paint, SkDrawFilter::Type type) { | 25 virtual bool filter(SkPaint* paint, SkDrawFilter::Type type) { |
26 if (type != SkDrawFilter::kText_Type) | 26 if (type != SkDrawFilter::kText_Type) |
27 return true; | 27 return true; |
28 | 28 |
29 paint->setLCDRenderText(false); | 29 paint->setLCDRenderText(false); |
30 return true; | 30 return true; |
31 } | 31 } |
32 }; | 32 }; |
33 | 33 } // namespace |
34 } | |
35 | 34 |
36 namespace cc { | 35 namespace cc { |
37 | 36 |
38 scoped_refptr<Picture> Picture::Create(gfx::Rect layer_rect) { | 37 scoped_refptr<Picture> Picture::Create(gfx::Rect layer_rect) { |
39 return make_scoped_refptr(new Picture(layer_rect)); | 38 return make_scoped_refptr(new Picture(layer_rect)); |
40 } | 39 } |
41 | 40 |
42 Picture::Picture(gfx::Rect layer_rect) | 41 Picture::Picture(gfx::Rect layer_rect) |
43 : layer_rect_(layer_rect) { | 42 : layer_rect_(layer_rect) { |
44 } | 43 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 if (!pixel_refs) | 161 if (!pixel_refs) |
163 return; | 162 return; |
164 | 163 |
165 void* data = const_cast<void*>(pixel_refs->data()); | 164 void* data = const_cast<void*>(pixel_refs->data()); |
166 if (!data) { | 165 if (!data) { |
167 pixel_refs->unref(); | 166 pixel_refs->unref(); |
168 return; | 167 return; |
169 } | 168 } |
170 | 169 |
171 SkPixelRef** refs = reinterpret_cast<SkPixelRef**>(data); | 170 SkPixelRef** refs = reinterpret_cast<SkPixelRef**>(data); |
172 for (unsigned int i = 0; i < pixel_refs->size() / sizeof(SkPixelRef*); ++i) { | 171 for (size_t i = 0; i < pixel_refs->size() / sizeof(*refs); ++i) { |
173 if (*refs && (*refs)->getURI() && !strncmp( | 172 if (*refs && (*refs)->getURI() && !strncmp( |
174 (*refs)->getURI(), kLabelLazyDecoded, 4)) { | 173 (*refs)->getURI(), kLabelLazyDecoded, 4)) { |
175 pixel_ref_list.push_back(static_cast<skia::LazyPixelRef*>(*refs)); | 174 pixel_ref_list.push_back(static_cast<skia::LazyPixelRef*>(*refs)); |
176 } | 175 } |
177 refs++; | 176 refs++; |
178 } | 177 } |
179 pixel_refs->unref(); | 178 pixel_refs->unref(); |
180 } | 179 } |
181 | 180 |
182 } // namespace cc | 181 } // namespace cc |
OLD | NEW |