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

Side by Side Diff: src/image/SkImage_Raster.cpp

Issue 13226002: Fixed bug with SkImage leaving canvas backing store in an immutable state after destroy. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/SurfaceTest.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 2012 Google Inc. 2 * Copyright 2012 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 "SkImage_Base.h" 8 #include "SkImage_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes ) 95 SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes )
96 : INHERITED(info.fWidth, info.fHeight) { 96 : INHERITED(info.fWidth, info.fHeight) {
97 bool isOpaque; 97 bool isOpaque;
98 SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque); 98 SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
99 99
100 fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes); 100 fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes);
101 fBitmap.setPixelRef(pr); 101 fBitmap.setPixelRef(pr);
102 fBitmap.setIsOpaque(isOpaque); 102 fBitmap.setIsOpaque(isOpaque);
103 fBitmap.setImmutable();
104 } 103 }
105 104
106 SkImage_Raster::~SkImage_Raster() {} 105 SkImage_Raster::~SkImage_Raster() {}
107 106
108 void SkImage_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPa int* paint) { 107 void SkImage_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPa int* paint) {
109 canvas->drawBitmap(fBitmap, x, y, paint); 108 canvas->drawBitmap(fBitmap, x, y, paint);
110 } 109 }
111 110
112 /////////////////////////////////////////////////////////////////////////////// 111 ///////////////////////////////////////////////////////////////////////////////
113 112
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 151 }
153 152
154 SkImage* SkNewImageFromPixelRef(const SkImage::Info& info, SkPixelRef* pr, 153 SkImage* SkNewImageFromPixelRef(const SkImage::Info& info, SkPixelRef* pr,
155 size_t rowBytes) { 154 size_t rowBytes) {
156 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes)); 155 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes));
157 } 156 }
158 157
159 SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) { 158 SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) {
160 return ((SkImage_Raster*)image)->getPixelRef(); 159 return ((SkImage_Raster*)image)->getPixelRef();
161 } 160 }
OLDNEW
« no previous file with comments | « no previous file | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698