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

Side by Side Diff: cc/picture.cc

Issue 12194015: cc: Rasterize cheap tiles immediately (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Trace event for cheap rasters that weren't. Created 7 years, 10 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 | Annotate | Revision Log
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 "third_party/skia/include/core/SkData.h" 10 #include "third_party/skia/include/core/SkData.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 DCHECK(picture_); 105 DCHECK(picture_);
106 106
107 canvas->save(); 107 canvas->save();
108 canvas->clipRect(gfx::RectToSkRect(content_rect)); 108 canvas->clipRect(gfx::RectToSkRect(content_rect));
109 canvas->scale(contents_scale, contents_scale); 109 canvas->scale(contents_scale, contents_scale);
110 canvas->translate(layer_rect_.x(), layer_rect_.y()); 110 canvas->translate(layer_rect_.x(), layer_rect_.y());
111 canvas->drawPicture(*picture_); 111 canvas->drawPicture(*picture_);
112 canvas->restore(); 112 canvas->restore();
113 } 113 }
114 114
115 bool Picture::IsCheapInRect(const gfx::Rect& layer_rect) { 115 bool Picture::IsCheapInRect(const gfx::Rect& layer_rect) const {
116 return false; 116 return false;
117 } 117 }
118 118
119 void Picture::GatherPixelRefs(const gfx::Rect& layer_rect, 119 void Picture::GatherPixelRefs(const gfx::Rect& layer_rect,
120 std::list<skia::LazyPixelRef*>& pixel_ref_list) { 120 std::list<skia::LazyPixelRef*>& pixel_ref_list) {
121 DCHECK(picture_); 121 DCHECK(picture_);
122 SkData* pixel_refs = SkPictureUtils::GatherPixelRefs( 122 SkData* pixel_refs = SkPictureUtils::GatherPixelRefs(
123 picture_.get(), SkRect::MakeXYWH(layer_rect.x(), 123 picture_.get(), SkRect::MakeXYWH(layer_rect.x(),
124 layer_rect.y(), 124 layer_rect.y(),
125 layer_rect.width(), 125 layer_rect.width(),
(...skipping 12 matching lines...) Expand all
138 if (*refs && (*refs)->getURI() && !strncmp( 138 if (*refs && (*refs)->getURI() && !strncmp(
139 (*refs)->getURI(), labelLazyDecoded, 4)) { 139 (*refs)->getURI(), labelLazyDecoded, 4)) {
140 pixel_ref_list.push_back(static_cast<skia::LazyPixelRef*>(*refs)); 140 pixel_ref_list.push_back(static_cast<skia::LazyPixelRef*>(*refs));
141 } 141 }
142 refs++; 142 refs++;
143 } 143 }
144 pixel_refs->unref(); 144 pixel_refs->unref();
145 } 145 }
146 146
147 } // namespace cc 147 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698