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

Side by Side Diff: gm/imagefiltersgraph.cpp

Issue 161733002: add peekPixels to SkCanvas and SkSurface (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 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 | « gm/imagefiltersclipped.cpp ('k') | gm/imagefiltersscaled.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 "gm.h" 8 #include "gm.h"
9 9
10 #include "SkArithmeticMode.h" 10 #include "SkArithmeticMode.h"
11 #include "SkDevice.h"
11 #include "SkBitmapSource.h" 12 #include "SkBitmapSource.h"
12 #include "SkBlurImageFilter.h" 13 #include "SkBlurImageFilter.h"
13 #include "SkColorFilter.h" 14 #include "SkColorFilter.h"
14 #include "SkColorFilterImageFilter.h" 15 #include "SkColorFilterImageFilter.h"
15 #include "SkColorMatrixFilter.h" 16 #include "SkColorMatrixFilter.h"
16 #include "SkReadBuffer.h" 17 #include "SkReadBuffer.h"
17 #include "SkWriteBuffer.h" 18 #include "SkWriteBuffer.h"
18 #include "SkMergeImageFilter.h" 19 #include "SkMergeImageFilter.h"
19 #include "SkMorphologyImageFilter.h" 20 #include "SkMorphologyImageFilter.h"
20 #include "SkOnce.h" 21 #include "SkOnce.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 SkOnce(&once, init_flattenable, &dummy); 87 SkOnce(&once, init_flattenable, &dummy);
87 } 88 }
88 89
89 protected: 90 protected:
90 virtual SkString onShortName() { 91 virtual SkString onShortName() {
91 return SkString("imagefiltersgraph"); 92 return SkString("imagefiltersgraph");
92 } 93 }
93 94
94 void make_bitmap() { 95 void make_bitmap() {
95 fBitmap.allocN32Pixels(100, 100); 96 fBitmap.allocN32Pixels(100, 100);
96 SkBitmapDevice device(fBitmap); 97 SkCanvas canvas(fBitmap);
97 SkCanvas canvas(&device);
98 canvas.clear(0x00000000); 98 canvas.clear(0x00000000);
99 SkPaint paint; 99 SkPaint paint;
100 paint.setAntiAlias(true); 100 paint.setAntiAlias(true);
101 paint.setColor(0xFFFFFFFF); 101 paint.setColor(0xFFFFFFFF);
102 paint.setTextSize(SkIntToScalar(96)); 102 paint.setTextSize(SkIntToScalar(96));
103 const char* str = "e"; 103 const char* str = "e";
104 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint); 104 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70), paint);
105 } 105 }
106 106
107 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai nt& paint) { 107 void drawClippedBitmap(SkCanvas* canvas, const SkBitmap& bitmap, const SkPai nt& paint) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 private: 206 private:
207 typedef GM INHERITED; 207 typedef GM INHERITED;
208 SkBitmap fBitmap; 208 SkBitmap fBitmap;
209 bool fInitialized; 209 bool fInitialized;
210 }; 210 };
211 211
212 /////////////////////////////////////////////////////////////////////////////// 212 ///////////////////////////////////////////////////////////////////////////////
213 213
214 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; } 214 static skiagm::GM* MyFactory(void*) { return new ImageFiltersGraphGM; }
215 static skiagm::GMRegistry reg(MyFactory); 215 static skiagm::GMRegistry reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/imagefiltersclipped.cpp ('k') | gm/imagefiltersscaled.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698