| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "skia/ext/pixel_ref_utils.h" | 5 #include "skia/ext/pixel_ref_utils.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "third_party/skia/include/core/SkBitmapDevice.h" | 9 #include "third_party/skia/include/core/SkBitmapDevice.h" |
| 10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 GatherPixelRefDevice::drawPoints( | 307 GatherPixelRefDevice::drawPoints( |
| 308 draw, SkCanvas::kPolygon_PointMode, vertex_count, verts, paint); | 308 draw, SkCanvas::kPolygon_PointMode, vertex_count, verts, paint); |
| 309 } | 309 } |
| 310 virtual void drawDevice(const SkDraw&, | 310 virtual void drawDevice(const SkDraw&, |
| 311 SkBaseDevice*, | 311 SkBaseDevice*, |
| 312 int x, | 312 int x, |
| 313 int y, | 313 int y, |
| 314 const SkPaint&) SK_OVERRIDE {} | 314 const SkPaint&) SK_OVERRIDE {} |
| 315 | 315 |
| 316 protected: | 316 protected: |
| 317 #ifdef SK_SUPPORT_LEGACY_READPIXELSCONFIG | |
| 318 virtual bool onReadPixels(const SkBitmap& bitmap, | |
| 319 int x, | |
| 320 int y, | |
| 321 SkCanvas::Config8888 config8888) SK_OVERRIDE { | |
| 322 return false; | |
| 323 } | |
| 324 #endif | |
| 325 | |
| 326 virtual bool onReadPixels(const SkImageInfo& info, | 317 virtual bool onReadPixels(const SkImageInfo& info, |
| 327 void* pixels, | 318 void* pixels, |
| 328 size_t rowBytes, | 319 size_t rowBytes, |
| 329 int x, | 320 int x, |
| 330 int y) SK_OVERRIDE { | 321 int y) SK_OVERRIDE { |
| 331 return false; | 322 return false; |
| 332 } | 323 } |
| 333 | 324 |
| 334 virtual bool onWritePixels(const SkImageInfo& info, | 325 virtual bool onWritePixels(const SkImageInfo& info, |
| 335 const void* pixels, | 326 const void* pixels, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 GatherPixelRefDevice device(empty_bitmap, &pixel_ref_set); | 367 GatherPixelRefDevice device(empty_bitmap, &pixel_ref_set); |
| 377 SkNoSaveLayerCanvas canvas(&device); | 368 SkNoSaveLayerCanvas canvas(&device); |
| 378 | 369 |
| 379 canvas.clipRect(SkRect::MakeWH(picture->width(), picture->height()), | 370 canvas.clipRect(SkRect::MakeWH(picture->width(), picture->height()), |
| 380 SkRegion::kIntersect_Op, | 371 SkRegion::kIntersect_Op, |
| 381 false); | 372 false); |
| 382 canvas.drawPicture(*picture); | 373 canvas.drawPicture(*picture); |
| 383 } | 374 } |
| 384 | 375 |
| 385 } // namespace skia | 376 } // namespace skia |
| OLD | NEW |