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

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

Issue 722043005: Revert of allow pictures to have a full bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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/SkRecorder.h ('k') | tests/PictureTest.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 2014 Google Inc. 2 * Copyright 2014 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 "SkData.h" 8 #include "SkData.h"
9 #include "SkRecorder.h" 9 #include "SkRecorder.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
11 #include "SkPicture.h" 11 #include "SkPicture.h"
12 12
13 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h eight.
13 SkRecorder::SkRecorder(SkRecord* record, int width, int height) 14 SkRecorder::SkRecorder(SkRecord* record, int width, int height)
14 : SkCanvas(SkIRect::MakeWH(width, height), SkCanvas::kConservativeRasterClip _InitFlag) 15 : SkCanvas(width, height, SkCanvas::kConservativeRasterClip_InitFlag)
15 , fRecord(record) 16 , fRecord(record)
16 , fSaveLayerCount(0) {} 17 , fSaveLayerCount(0) {}
17 18
18 SkRecorder::SkRecorder(SkRecord* record, const SkRect& bounds)
19 : SkCanvas(bounds.roundOut(), SkCanvas::kConservativeRasterClip_InitFlag)
20 , fRecord(record)
21 , fSaveLayerCount(0) {}
22
23 SkRecorder::~SkRecorder() { 19 SkRecorder::~SkRecorder() {
24 fDrawableList.unrefAll(); 20 fDrawableList.unrefAll();
25 } 21 }
26 22
27 void SkRecorder::forgetRecord() { 23 void SkRecorder::forgetRecord() {
28 fDrawableList.unrefAll(); 24 fDrawableList.unrefAll();
29 fDrawableList.reset(); 25 fDrawableList.reset();
30 fRecord = NULL; 26 fRecord = NULL;
31 } 27 }
32 28
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 APPEND(EndCommentGroup); 367 APPEND(EndCommentGroup);
372 } 368 }
373 369
374 bool SkRecorder::isDrawingToLayer() const { 370 bool SkRecorder::isDrawingToLayer() const {
375 return fSaveLayerCount > 0; 371 return fSaveLayerCount > 0;
376 } 372 }
377 373
378 void SkRecorder::drawData(const void* data, size_t length) { 374 void SkRecorder::drawData(const void* data, size_t length) {
379 APPEND(DrawData, copy((const char*)data), length); 375 APPEND(DrawData, copy((const char*)data), length);
380 } 376 }
OLDNEW
« no previous file with comments | « src/core/SkRecorder.h ('k') | tests/PictureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698