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

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

Issue 1062353002: Revert of SkCanvas::resetForNextPicture() (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 8 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 | « include/core/SkCanvas.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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return SkNEW_ARGS(SkBitmapDevice, (bitmap, *props)); 96 return SkNEW_ARGS(SkBitmapDevice, (bitmap, *props));
97 } else { 97 } else {
98 return SkNEW_ARGS(SkBitmapDevice, (bitmap)); 98 return SkNEW_ARGS(SkBitmapDevice, (bitmap));
99 } 99 }
100 } 100 }
101 101
102 SkImageInfo SkBitmapDevice::imageInfo() const { 102 SkImageInfo SkBitmapDevice::imageInfo() const {
103 return fBitmap.info(); 103 return fBitmap.info();
104 } 104 }
105 105
106 void SkBitmapDevice::setNewSize(const SkISize& size) {
107 SkASSERT(!fBitmap.pixelRef());
108 fBitmap.setInfo(fBitmap.info().makeWH(size.fWidth, size.fHeight));
109 }
110
111 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) { 106 void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) {
112 SkASSERT(bm.width() == fBitmap.width()); 107 SkASSERT(bm.width() == fBitmap.width());
113 SkASSERT(bm.height() == fBitmap.height()); 108 SkASSERT(bm.height() == fBitmap.height());
114 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config) 109 fBitmap = bm; // intent is to use bm's pixelRef (and rowbytes/config)
115 fBitmap.lockPixels(); 110 fBitmap.lockPixels();
116 } 111 }
117 112
118 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa int*) { 113 SkBaseDevice* SkBitmapDevice::onCreateDevice(const CreateInfo& cinfo, const SkPa int*) {
119 SkDeviceProperties leaky(cinfo.fPixelGeometry); 114 SkDeviceProperties leaky(cinfo.fPixelGeometry);
120 return SkBitmapDevice::Create(cinfo.fInfo, &leaky); 115 return SkBitmapDevice::Create(cinfo.fInfo, &leaky);
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 paint.getRasterizer() || 376 paint.getRasterizer() ||
382 paint.getPathEffect() || 377 paint.getPathEffect() ||
383 paint.isFakeBoldText() || 378 paint.isFakeBoldText() ||
384 paint.getStyle() != SkPaint::kFill_Style || 379 paint.getStyle() != SkPaint::kFill_Style ||
385 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) 380 !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
386 { 381 {
387 return true; 382 return true;
388 } 383 }
389 return false; 384 return false;
390 } 385 }
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698