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

Side by Side Diff: samplecode/SampleAll.cpp

Issue 19825002: stop using bitmap-filter flags outside of paint itself, as a step towards really changing them into… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 5 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/core/SkPaint.h ('k') | src/core/SkBitmapFilter.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkView.h" 10 #include "SkView.h"
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 SkScalar radius = SkIntToScalar(12)/5; 385 SkScalar radius = SkIntToScalar(12)/5;
386 SkEmbossMaskFilter* embossFilter = new SkEmbossMaskFilter(light, 386 SkEmbossMaskFilter* embossFilter = new SkEmbossMaskFilter(light,
387 radius); 387 radius);
388 388
389 SkXfermode* xfermode = SkXfermode::Create(SkXfermode::kXor_Mode); 389 SkXfermode* xfermode = SkXfermode::Create(SkXfermode::kXor_Mode);
390 SkColorFilter* lightingFilter = SkColorFilter::CreateLightingFilter( 390 SkColorFilter* lightingFilter = SkColorFilter::CreateLightingFilter(
391 0xff89bc45, 0xff112233); 391 0xff89bc45, 0xff112233);
392 392
393 canvas->save(); 393 canvas->save();
394 canvas->translate(SkIntToScalar(0), SkIntToScalar(5)); 394 canvas->translate(SkIntToScalar(0), SkIntToScalar(5));
395 paint.setFlags(SkPaint::kAntiAlias_Flag | SkPaint::kFilterBitmap_Flag); 395 paint.setAntiAlias(true);
396 paint.setFilterLevel(SkPaint::kLow_FilterLevel);
396 // !!! draw through a clip 397 // !!! draw through a clip
397 paint.setColor(SK_ColorLTGRAY); 398 paint.setColor(SK_ColorLTGRAY);
398 paint.setStyle(SkPaint::kFill_Style); 399 paint.setStyle(SkPaint::kFill_Style);
399 SkRect clip = {0, 0, SkIntToScalar(320), SkIntToScalar(120)}; 400 SkRect clip = {0, 0, SkIntToScalar(320), SkIntToScalar(120)};
400 canvas->clipRect(clip); 401 canvas->clipRect(clip);
401 paint.setShader(SkShader::CreateBitmapShader(fTx, 402 paint.setShader(SkShader::CreateBitmapShader(fTx,
402 SkShader::kMirror_TileMode, SkShader::kRepeat_TileMode))->unref(); 403 SkShader::kMirror_TileMode, SkShader::kRepeat_TileMode))->unref();
403 canvas->drawPaint(paint); 404 canvas->drawPaint(paint);
404 canvas->save(); 405 canvas->save();
405 406
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 private: 638 private:
638 SkPoint fClickPt; 639 SkPoint fClickPt;
639 SkBitmap fBug, fTb, fTx; 640 SkBitmap fBug, fTb, fTx;
640 typedef SampleView INHERITED; 641 typedef SampleView INHERITED;
641 }; 642 };
642 643
643 ////////////////////////////////////////////////////////////////////////////// 644 //////////////////////////////////////////////////////////////////////////////
644 645
645 static SkView* MyFactory() { return new DemoView; } 646 static SkView* MyFactory() { return new DemoView; }
646 static SkViewRegister reg(MyFactory); 647 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « include/core/SkPaint.h ('k') | src/core/SkBitmapFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698