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

Side by Side Diff: src/effects/SkRectShaderImageFilter.cpp

Issue 22978012: Split SkDevice into SkBaseDevice and SkBitmapDevice (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Updating to ToT (10994) Created 7 years, 3 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 | « src/effects/SkMergeImageFilter.cpp ('k') | src/effects/SkTestImageFilters.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 "SkRectShaderImageFilter.h" 8 #include "SkRectShaderImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 SkIPoint*) { 49 SkIPoint*) {
50 SkRect rect(fRect); 50 SkRect rect(fRect);
51 if (rect.isEmpty()) { 51 if (rect.isEmpty()) {
52 rect = SkRect::MakeWH(SkIntToScalar(source.width()), SkIntToScalar(sourc e.height())); 52 rect = SkRect::MakeWH(SkIntToScalar(source.width()), SkIntToScalar(sourc e.height()));
53 } 53 }
54 54
55 if (rect.isEmpty()) { 55 if (rect.isEmpty()) {
56 return false; 56 return false;
57 } 57 }
58 58
59 SkAutoTUnref<SkDevice> device(proxy->createDevice(SkScalarCeilToInt(rect.wid th()), 59 SkAutoTUnref<SkBaseDevice> device(proxy->createDevice(SkScalarCeilToInt(rect .width()),
60 SkScalarCeilToInt(rect.hei ght()))); 60 SkScalarCeilToInt(rect .height())));
61 SkCanvas canvas(device.get()); 61 SkCanvas canvas(device.get());
62 SkPaint paint; 62 SkPaint paint;
63 paint.setShader(fShader); 63 paint.setShader(fShader);
64 canvas.drawRect(rect, paint); 64 canvas.drawRect(rect, paint);
65 *result = device.get()->accessBitmap(false); 65 *result = device.get()->accessBitmap(false);
66 return true; 66 return true;
67 } 67 }
OLDNEW
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | src/effects/SkTestImageFilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698