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

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

Issue 847443003: rename blitrow::proc and add (uncalled) hook for colorproc16 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « src/core/SkBlitter_RGB16.cpp ('k') | src/opts/SkBlitRow_opts_arm.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 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 8
9 9
10 #include "SkSpriteBlitter.h" 10 #include "SkSpriteBlitter.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 if (paint.getAlpha() < 0xFF) { 272 if (paint.getAlpha() < 0xFF) {
273 flags |= SkBlitRow::kGlobalAlpha_Flag; 273 flags |= SkBlitRow::kGlobalAlpha_Flag;
274 } 274 }
275 if (!fSource->isOpaque()) { 275 if (!fSource->isOpaque()) {
276 flags |= SkBlitRow::kSrcPixelAlpha_Flag; 276 flags |= SkBlitRow::kSrcPixelAlpha_Flag;
277 } 277 }
278 if (paint.isDither()) { 278 if (paint.isDither()) {
279 flags |= SkBlitRow::kDither_Flag; 279 flags |= SkBlitRow::kDither_Flag;
280 } 280 }
281 fProc = SkBlitRow::Factory(flags, kRGB_565_SkColorType); 281 fProc = SkBlitRow::Factory16(flags);
282 } 282 }
283 283
284 void blitRect(int x, int y, int width, int height) SK_OVERRIDE { 284 void blitRect(int x, int y, int width, int height) SK_OVERRIDE {
285 uint16_t* SK_RESTRICT dst = fDevice->getAddr16(x, y); 285 uint16_t* SK_RESTRICT dst = fDevice->getAddr16(x, y);
286 const SkPMColor* SK_RESTRICT src = fSource->getAddr32(x - fLeft, 286 const SkPMColor* SK_RESTRICT src = fSource->getAddr32(x - fLeft,
287 y - fTop); 287 y - fTop);
288 size_t dstRB = fDevice->rowBytes(); 288 size_t dstRB = fDevice->rowBytes();
289 size_t srcRB = fSource->rowBytes(); 289 size_t srcRB = fSource->rowBytes();
290 SkBlitRow::Proc proc = fProc; 290 SkBlitRow::Proc16 proc = fProc;
291 U8CPU alpha = fPaint->getAlpha(); 291 U8CPU alpha = fPaint->getAlpha();
292 292
293 while (--height >= 0) { 293 while (--height >= 0) {
294 proc(dst, src, width, alpha, x, y); 294 proc(dst, src, width, alpha, x, y);
295 y += 1; 295 y += 1;
296 dst = (uint16_t* SK_RESTRICT)((char*)dst + dstRB); 296 dst = (uint16_t* SK_RESTRICT)((char*)dst + dstRB);
297 src = (const SkPMColor* SK_RESTRICT)((const char*)src + srcRB); 297 src = (const SkPMColor* SK_RESTRICT)((const char*)src + srcRB);
298 } 298 }
299 } 299 }
300 300
301 private: 301 private:
302 SkBlitRow::Proc fProc; 302 SkBlitRow::Proc16 fProc;
303 303
304 typedef SkSpriteBlitter INHERITED; 304 typedef SkSpriteBlitter INHERITED;
305 }; 305 };
306 306
307 /////////////////////////////////////////////////////////////////////////////// 307 ///////////////////////////////////////////////////////////////////////////////
308 308
309 SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, const SkPain t& paint, 309 SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkBitmap& source, const SkPain t& paint,
310 SkTBlitterAllocator* allocator) { 310 SkTBlitterAllocator* allocator) {
311 311
312 SkASSERT(allocator != NULL); 312 SkASSERT(allocator != NULL);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 } else { 371 } else {
372 blitter = allocator->createT<Sprite_D16_SIndex8A_Blend>(sour ce, alpha); 372 blitter = allocator->createT<Sprite_D16_SIndex8A_Blend>(sour ce, alpha);
373 } 373 }
374 } 374 }
375 break; 375 break;
376 default: 376 default:
377 break; 377 break;
378 } 378 }
379 return blitter; 379 return blitter;
380 } 380 }
OLDNEW
« no previous file with comments | « src/core/SkBlitter_RGB16.cpp ('k') | src/opts/SkBlitRow_opts_arm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698