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

Side by Side Diff: src/pipe/SkGPipeRead.cpp

Issue 1228083004: add src-rect-constraint to drawImageRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
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 8
9 9
10 #include "SkBitmapHeap.h" 10 #include "SkBitmapHeap.h"
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 SkGPipeState* state) { 682 SkGPipeState* state) {
683 unsigned slot = DrawOp_unpackData(op32); 683 unsigned slot = DrawOp_unpackData(op32);
684 unsigned flags = DrawOp_unpackFlags(op32); 684 unsigned flags = DrawOp_unpackFlags(op32);
685 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag); 685 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag);
686 bool hasSrc = SkToBool(flags & kDrawBitmap_HasSrcRect_DrawOpFlag); 686 bool hasSrc = SkToBool(flags & kDrawBitmap_HasSrcRect_DrawOpFlag);
687 const SkRect* src = NULL; 687 const SkRect* src = NULL;
688 if (hasSrc) { 688 if (hasSrc) {
689 src = skip<SkRect>(reader); 689 src = skip<SkRect>(reader);
690 } 690 }
691 const SkRect* dst = skip<SkRect>(reader); 691 const SkRect* dst = skip<SkRect>(reader);
692 SkCanvas::SrcRectConstraint constraint = (SkCanvas::SrcRectConstraint)reader ->readInt();
693
692 const SkImage* image = state->getImage(slot); 694 const SkImage* image = state->getImage(slot);
693 if (state->shouldDraw()) { 695 if (state->shouldDraw()) {
694 canvas->drawImageRect(image, src, *dst, hasPaint ? &state->paint() : NUL L); 696 canvas->drawImageRect(image, src, *dst, hasPaint ? &state->paint() : NUL L, constraint);
695 } 697 }
696 } 698 }
697 699
698 static void drawImageNine_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32 , 700 static void drawImageNine_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32 ,
699 SkGPipeState* state) { 701 SkGPipeState* state) {
700 unsigned slot = DrawOp_unpackData(op32); 702 unsigned slot = DrawOp_unpackData(op32);
701 unsigned flags = DrawOp_unpackFlags(op32); 703 unsigned flags = DrawOp_unpackFlags(op32);
702 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag); 704 bool hasPaint = SkToBool(flags & kDrawBitmap_HasPaint_DrawOpFlag);
703 const SkIRect* center = skip<SkIRect>(reader); 705 const SkIRect* center = skip<SkIRect>(reader);
704 const SkRect* dst = skip<SkRect>(reader); 706 const SkRect* dst = skip<SkRect>(reader);
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 status = kReadAtom_Status; 1009 status = kReadAtom_Status;
1008 break; 1010 break;
1009 } 1011 }
1010 } 1012 }
1011 1013
1012 if (bytesRead) { 1014 if (bytesRead) {
1013 *bytesRead = reader.offset(); 1015 *bytesRead = reader.offset();
1014 } 1016 }
1015 return status; 1017 return status;
1016 } 1018 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698