| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/paint/paint_canvas.h" | 5 #include "cc/paint/paint_canvas.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "cc/paint/paint_record.h" | 8 #include "cc/paint/paint_record.h" |
| 9 #include "cc/paint/paint_recorder.h" | 9 #include "cc/paint/paint_recorder.h" |
| 10 #include "third_party/skia/include/core/SkAnnotation.h" | 10 #include "third_party/skia/include/core/SkAnnotation.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 const SkMatrix& SkiaPaintCanvas::getTotalMatrix() const { | 312 const SkMatrix& SkiaPaintCanvas::getTotalMatrix() const { |
| 313 return canvas_->getTotalMatrix(); | 313 return canvas_->getTotalMatrix(); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void SkiaPaintCanvas::temporary_internal_describeTopLayer( | 316 void SkiaPaintCanvas::temporary_internal_describeTopLayer( |
| 317 SkMatrix* matrix, | 317 SkMatrix* matrix, |
| 318 SkIRect* clip_bounds) { | 318 SkIRect* clip_bounds) { |
| 319 return canvas_->temporary_internal_describeTopLayer(matrix, clip_bounds); | 319 return canvas_->temporary_internal_describeTopLayer(matrix, clip_bounds); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void SkiaPaintCanvas::PlaybackPaintRecord(PaintRecord* record) { |
| 323 record->playback(canvas_); |
| 324 } |
| 325 |
| 322 bool SkiaPaintCanvas::ToPixmap(SkPixmap* output) { | 326 bool SkiaPaintCanvas::ToPixmap(SkPixmap* output) { |
| 323 SkImageInfo info; | 327 SkImageInfo info; |
| 324 size_t row_bytes; | 328 size_t row_bytes; |
| 325 void* pixels = canvas_->accessTopLayerPixels(&info, &row_bytes); | 329 void* pixels = canvas_->accessTopLayerPixels(&info, &row_bytes); |
| 326 if (!pixels) { | 330 if (!pixels) { |
| 327 output->reset(); | 331 output->reset(); |
| 328 return false; | 332 return false; |
| 329 } | 333 } |
| 330 | 334 |
| 331 output->reset(info, pixels, row_bytes); | 335 output->reset(info, pixels, row_bytes); |
| 332 return true; | 336 return true; |
| 333 } | 337 } |
| 334 | 338 |
| 335 void SkiaPaintCanvas::AnnotateRectWithURL(const SkRect& rect, SkData* data) { | 339 void SkiaPaintCanvas::AnnotateRectWithURL(const SkRect& rect, SkData* data) { |
| 336 SkAnnotateRectWithURL(canvas_, rect, data); | 340 SkAnnotateRectWithURL(canvas_, rect, data); |
| 337 } | 341 } |
| 338 | 342 |
| 339 void SkiaPaintCanvas::AnnotateNamedDestination(const SkPoint& point, | 343 void SkiaPaintCanvas::AnnotateNamedDestination(const SkPoint& point, |
| 340 SkData* data) { | 344 SkData* data) { |
| 341 SkAnnotateNamedDestination(canvas_, point, data); | 345 SkAnnotateNamedDestination(canvas_, point, data); |
| 342 } | 346 } |
| 343 | 347 |
| 344 void SkiaPaintCanvas::AnnotateLinkToDestination(const SkRect& rect, | 348 void SkiaPaintCanvas::AnnotateLinkToDestination(const SkRect& rect, |
| 345 SkData* data) { | 349 SkData* data) { |
| 346 SkAnnotateLinkToDestination(canvas_, rect, data); | 350 SkAnnotateLinkToDestination(canvas_, rect, data); |
| 347 } | 351 } |
| 348 | 352 |
| 349 } // namespace cc | 353 } // namespace cc |
| OLD | NEW |