OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkBitmapDevice.h" | 10 #include "SkBitmapDevice.h" |
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 // if x or y are negative, then we have to adjust pixels | 746 // if x or y are negative, then we have to adjust pixels |
747 if (x > 0) { | 747 if (x > 0) { |
748 x = 0; | 748 x = 0; |
749 } | 749 } |
750 if (y > 0) { | 750 if (y > 0) { |
751 y = 0; | 751 y = 0; |
752 } | 752 } |
753 // here x,y are either 0 or negative | 753 // here x,y are either 0 or negative |
754 pixels = ((const char*)pixels - y * rowBytes - x * info.bytesPerPixel()); | 754 pixels = ((const char*)pixels - y * rowBytes - x * info.bytesPerPixel()); |
755 | 755 |
| 756 // Tell our owning surface to bump its generation ID |
| 757 this->predrawNotify(); |
| 758 |
756 // The device can assert that the requested area is always contained in its
bounds | 759 // The device can assert that the requested area is always contained in its
bounds |
757 return device->writePixels(info, pixels, rowBytes, target.x(), target.y()); | 760 return device->writePixels(info, pixels, rowBytes, target.x(), target.y()); |
758 } | 761 } |
759 | 762 |
760 SkCanvas* SkCanvas::canvasForDrawIter() { | 763 SkCanvas* SkCanvas::canvasForDrawIter() { |
761 return this; | 764 return this; |
762 } | 765 } |
763 | 766 |
764 ////////////////////////////////////////////////////////////////////////////// | 767 ////////////////////////////////////////////////////////////////////////////// |
765 | 768 |
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2582 if (!supported_for_raster_canvas(info)) { | 2585 if (!supported_for_raster_canvas(info)) { |
2583 return NULL; | 2586 return NULL; |
2584 } | 2587 } |
2585 | 2588 |
2586 SkBitmap bitmap; | 2589 SkBitmap bitmap; |
2587 if (!bitmap.installPixels(info, pixels, rowBytes)) { | 2590 if (!bitmap.installPixels(info, pixels, rowBytes)) { |
2588 return NULL; | 2591 return NULL; |
2589 } | 2592 } |
2590 return SkNEW_ARGS(SkCanvas, (bitmap)); | 2593 return SkNEW_ARGS(SkCanvas, (bitmap)); |
2591 } | 2594 } |
OLD | NEW |