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

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

Issue 783493002: Change clear() to respect the clip (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | « include/utils/SkNWayCanvas.h ('k') | src/core/SkCanvas.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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 #include "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkConfig8888.h" 9 #include "SkConfig8888.h"
10 #include "SkDeviceProperties.h" 10 #include "SkDeviceProperties.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 fBitmap.lockPixels(); 120 fBitmap.lockPixels();
121 } 121 }
122 } 122 }
123 123
124 void SkBitmapDevice::unlockPixels() { 124 void SkBitmapDevice::unlockPixels() {
125 if (fBitmap.lockPixelsAreWritable()) { 125 if (fBitmap.lockPixelsAreWritable()) {
126 fBitmap.unlockPixels(); 126 fBitmap.unlockPixels();
127 } 127 }
128 } 128 }
129 129
130 void SkBitmapDevice::clear(SkColor color) {
131 fBitmap.eraseColor(color);
132 }
133
134 const SkBitmap& SkBitmapDevice::onAccessBitmap() { 130 const SkBitmap& SkBitmapDevice::onAccessBitmap() {
135 return fBitmap; 131 return fBitmap;
136 } 132 }
137 133
138 void* SkBitmapDevice::onAccessPixels(SkImageInfo* info, size_t* rowBytes) { 134 void* SkBitmapDevice::onAccessPixels(SkImageInfo* info, size_t* rowBytes) {
139 if (fBitmap.getPixels()) { 135 if (fBitmap.getPixels()) {
140 *info = fBitmap.info(); 136 *info = fBitmap.info();
141 *rowBytes = fBitmap.rowBytes(); 137 *rowBytes = fBitmap.rowBytes();
142 return fBitmap.getPixels(); 138 return fBitmap.getPixels();
143 } 139 }
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 paint.getRasterizer() || 383 paint.getRasterizer() ||
388 paint.getPathEffect() || 384 paint.getPathEffect() ||
389 paint.isFakeBoldText() || 385 paint.isFakeBoldText() ||
390 paint.getStyle() != SkPaint::kFill_Style || 386 paint.getStyle() != SkPaint::kFill_Style ||
391 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) 387 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
392 { 388 {
393 return true; 389 return true;
394 } 390 }
395 return false; 391 return false;
396 } 392 }
OLDNEW
« no previous file with comments | « include/utils/SkNWayCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698