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: src/core/SkCanvas.cpp

Issue 2494353002: Revert of Make SkSmallAllocator obey the RAII invariants and be expandable (Closed)
Patch Set: Created 4 years, 1 month 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.cpp ('k') | src/core/SkDrawLooper.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 // Make rawBounds include all paint outsets except for those due to image filters. 488 // Make rawBounds include all paint outsets except for those due to image filters.
489 rawBounds = &apply_paint_to_bounds_sans_imagefilter(*fPaint, *ra wBounds, &storage); 489 rawBounds = &apply_paint_to_bounds_sans_imagefilter(*fPaint, *ra wBounds, &storage);
490 } 490 }
491 (void)canvas->internalSaveLayer(SkCanvas::SaveLayerRec(rawBounds, &t mp), 491 (void)canvas->internalSaveLayer(SkCanvas::SaveLayerRec(rawBounds, &t mp),
492 SkCanvas::kFullLayer_SaveLayerStrate gy); 492 SkCanvas::kFullLayer_SaveLayerStrate gy);
493 fTempLayerForImageFilter = true; 493 fTempLayerForImageFilter = true;
494 // we remove the imagefilter/xfermode inside doNext() 494 // we remove the imagefilter/xfermode inside doNext()
495 } 495 }
496 496
497 if (SkDrawLooper* looper = paint.getLooper()) { 497 if (SkDrawLooper* looper = paint.getLooper()) {
498 fLooperContext = fLooperContextAllocator.createWithIniter( 498 void* buffer = fLooperContextAllocator.reserveT<SkDrawLooper::Contex t>(
499 looper->contextSize(), 499 looper->contextSize());
500 [&](void* buffer) { 500 fLooperContext = looper->createContext(canvas, buffer);
501 return looper->createContext(canvas, buffer);
502 });
503 fIsSimple = false; 501 fIsSimple = false;
504 } else { 502 } else {
505 fLooperContext = nullptr; 503 fLooperContext = nullptr;
506 // can we be marked as simple? 504 // can we be marked as simple?
507 fIsSimple = !fFilter && !fTempLayerForImageFilter; 505 fIsSimple = !fFilter && !fTempLayerForImageFilter;
508 } 506 }
509 } 507 }
510 508
511 ~AutoDrawLooper() { 509 ~AutoDrawLooper() {
512 if (fTempLayerForImageFilter) { 510 if (fTempLayerForImageFilter) {
(...skipping 2858 matching lines...) Expand 10 before | Expand all | Expand 10 after
3371 const SkCanvas::ClipOp SkCanvas::kXOR_Op; 3369 const SkCanvas::ClipOp SkCanvas::kXOR_Op;
3372 const SkCanvas::ClipOp SkCanvas::kReverseDifference_Op; 3370 const SkCanvas::ClipOp SkCanvas::kReverseDifference_Op;
3373 const SkCanvas::ClipOp SkCanvas::kReplace_Op; 3371 const SkCanvas::ClipOp SkCanvas::kReplace_Op;
3374 3372
3375 static_assert((int)SkRegion::kDifference_Op == (int)kDifference_SkClipOp , ""); 3373 static_assert((int)SkRegion::kDifference_Op == (int)kDifference_SkClipOp , "");
3376 static_assert((int)SkRegion::kIntersect_Op == (int)kIntersect_SkClipOp, ""); 3374 static_assert((int)SkRegion::kIntersect_Op == (int)kIntersect_SkClipOp, "");
3377 static_assert((int)SkRegion::kUnion_Op == (int)kUnion_SkClipOp, "") ; 3375 static_assert((int)SkRegion::kUnion_Op == (int)kUnion_SkClipOp, "") ;
3378 static_assert((int)SkRegion::kXOR_Op == (int)kXOR_SkClipOp, ""); 3376 static_assert((int)SkRegion::kXOR_Op == (int)kXOR_SkClipOp, "");
3379 static_assert((int)SkRegion::kReverseDifference_Op == (int)kReverseDifference_S kClipOp, ""); 3377 static_assert((int)SkRegion::kReverseDifference_Op == (int)kReverseDifference_S kClipOp, "");
3380 static_assert((int)SkRegion::kReplace_Op == (int)kReplace_SkClipOp, " "); 3378 static_assert((int)SkRegion::kReplace_Op == (int)kReplace_SkClipOp, " ");
OLDNEW
« no previous file with comments | « src/core/SkBlitter.cpp ('k') | src/core/SkDrawLooper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698