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

Side by Side Diff: cc/picture.cc

Issue 11553033: cc: Disable use of Skia r-tree for impl-side painting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/debug/trace_event.h" 5 #include "base/debug/trace_event.h"
6 #include "cc/content_layer_client.h" 6 #include "cc/content_layer_client.h"
7 #include "cc/picture.h" 7 #include "cc/picture.h"
8 #include "cc/rendering_stats.h" 8 #include "cc/rendering_stats.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "ui/gfx/rect_conversions.h" 10 #include "ui/gfx/rect_conversions.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 void Picture::Record(ContentLayerClient* painter, 41 void Picture::Record(ContentLayerClient* painter,
42 RenderingStats& stats) { 42 RenderingStats& stats) {
43 TRACE_EVENT0("cc", "Picture::Record"); 43 TRACE_EVENT0("cc", "Picture::Record");
44 44
45 // Record() should only be called once. 45 // Record() should only be called once.
46 DCHECK(!picture_); 46 DCHECK(!picture_);
47 picture_ = skia::AdoptRef(new SkPicture); 47 picture_ = skia::AdoptRef(new SkPicture);
48 48
49 // TODO(enne): Use SkPicture::kOptimizeForClippedPlayback_RecordingFlag
50 // once http://code.google.com/p/skia/issues/detail?id=1014 is fixed.
49 SkCanvas* canvas = picture_->beginRecording( 51 SkCanvas* canvas = picture_->beginRecording(
50 layer_rect_.width(), 52 layer_rect_.width(),
51 layer_rect_.height(), 53 layer_rect_.height());
52 SkPicture::kOptimizeForClippedPlayback_RecordingFlag);
53 54
54 canvas->save(); 55 canvas->save();
55 canvas->translate(SkFloatToScalar(-layer_rect_.x()), 56 canvas->translate(SkFloatToScalar(-layer_rect_.x()),
56 SkFloatToScalar(-layer_rect_.y())); 57 SkFloatToScalar(-layer_rect_.y()));
57 58
58 SkPaint paint; 59 SkPaint paint;
59 paint.setAntiAlias(false); 60 paint.setAntiAlias(false);
60 paint.setXfermodeMode(SkXfermode::kClear_Mode); 61 paint.setXfermodeMode(SkXfermode::kClear_Mode);
61 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(), 62 SkRect layer_skrect = SkRect::MakeXYWH(layer_rect_.x(),
62 layer_rect_.y(), 63 layer_rect_.y(),
(...skipping 19 matching lines...) Expand all
82 void Picture::Raster(SkCanvas* canvas) { 83 void Picture::Raster(SkCanvas* canvas) {
83 TRACE_EVENT0("cc", "Picture::Raster"); 84 TRACE_EVENT0("cc", "Picture::Raster");
84 DCHECK(picture_); 85 DCHECK(picture_);
85 canvas->save(); 86 canvas->save();
86 canvas->translate(layer_rect_.x(), layer_rect_.y()); 87 canvas->translate(layer_rect_.x(), layer_rect_.y());
87 canvas->drawPicture(*picture_); 88 canvas->drawPicture(*picture_);
88 canvas->restore(); 89 canvas->restore();
89 } 90 }
90 91
91 } // namespace cc 92 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698