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

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

Issue 197433002: support direct writing to top layer (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « include/utils/SkDeferredCanvas.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 "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 SkRasterClip clip(SkIRect::MakeWH(fBitmap.width(), fBitmap.height())); 261 SkRasterClip clip(SkIRect::MakeWH(fBitmap.width(), fBitmap.height()));
262 SkDraw draw; 262 SkDraw draw;
263 draw.fRC = &clip; 263 draw.fRC = &clip;
264 draw.fClip = &clip.bwRgn(); 264 draw.fClip = &clip.bwRgn();
265 draw.fBitmap = &fBitmap; // canvas should have already called accessBitmap 265 draw.fBitmap = &fBitmap; // canvas should have already called accessBitmap
266 draw.fMatrix = &SkMatrix::I(); 266 draw.fMatrix = &SkMatrix::I();
267 this->drawSprite(draw, *sprite, x, y, paint); 267 this->drawSprite(draw, *sprite, x, y, paint);
268 } 268 }
269 #endif 269 #endif
270 270
271 void* SkBitmapDevice::onAccessPixels(SkImageInfo* info, size_t* rowBytes) {
272 if (fBitmap.getPixels()) {
273 *info = fBitmap.info();
274 *rowBytes = fBitmap.rowBytes();
275 return fBitmap.getPixels();
276 }
277 return NULL;
278 }
279
271 static void rect_memcpy(void* dst, size_t dstRB, const void* src, size_t srcRB, size_t bytesPerRow, 280 static void rect_memcpy(void* dst, size_t dstRB, const void* src, size_t srcRB, size_t bytesPerRow,
272 int rowCount) { 281 int rowCount) {
273 SkASSERT(bytesPerRow <= srcRB); 282 SkASSERT(bytesPerRow <= srcRB);
274 SkASSERT(bytesPerRow <= dstRB); 283 SkASSERT(bytesPerRow <= dstRB);
275 for (int i = 0; i < rowCount; ++i) { 284 for (int i = 0; i < rowCount; ++i) {
276 memcpy(dst, src, bytesPerRow); 285 memcpy(dst, src, bytesPerRow);
277 dst = (char*)dst + dstRB; 286 dst = (char*)dst + dstRB;
278 src = (const char*)src + srcRB; 287 src = (const char*)src + srcRB;
279 } 288 }
280 } 289 }
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 paint.getStyle() != SkPaint::kFill_Style || 575 paint.getStyle() != SkPaint::kFill_Style ||
567 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) { 576 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) {
568 // turn off lcd 577 // turn off lcd
569 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag; 578 flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag;
570 flags->fHinting = paint.getHinting(); 579 flags->fHinting = paint.getHinting();
571 return true; 580 return true;
572 } 581 }
573 // we're cool with the paint as is 582 // we're cool with the paint as is
574 return false; 583 return false;
575 } 584 }
OLDNEW
« no previous file with comments | « include/utils/SkDeferredCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698