Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: src/core/SkCanvas.cpp

Issue 352573005: writepixels needs to bump genID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/WritePixelsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | tests/WritePixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698