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

Side by Side Diff: cc/layers/picture_layer.cc

Issue 253013003: Enable disabling WebCore::GraphicsContext in telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch to land Created 6 years, 7 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
« no previous file with comments | « cc/layers/picture_image_layer.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | 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 "cc/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/picture_layer_impl.h" 8 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/trees/layer_tree_impl.h" 9 #include "cc/trees/layer_tree_impl.h"
10 #include "third_party/skia/include/core/SkPictureRecorder.h" 10 #include "third_party/skia/include/core/SkPictureRecorder.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // picture. For now we just paint a fresh one to get consistent results. 163 // picture. For now we just paint a fresh one to get consistent results.
164 if (!DrawsContent()) 164 if (!DrawsContent())
165 return skia::RefPtr<SkPicture>(); 165 return skia::RefPtr<SkPicture>();
166 166
167 int width = bounds().width(); 167 int width = bounds().width();
168 int height = bounds().height(); 168 int height = bounds().height();
169 gfx::RectF opaque; 169 gfx::RectF opaque;
170 170
171 SkPictureRecorder recorder; 171 SkPictureRecorder recorder;
172 SkCanvas* canvas = recorder.beginRecording(width, height, NULL, 0); 172 SkCanvas* canvas = recorder.beginRecording(width, height, NULL, 0);
173 client_->PaintContents(canvas, gfx::Rect(width, height), &opaque); 173 client_->PaintContents(canvas,
174 gfx::Rect(width, height),
175 &opaque,
176 ContentLayerClient::GRAPHICS_CONTEXT_ENABLED);
174 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); 177 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
175 return picture; 178 return picture;
176 } 179 }
177 180
178 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { 181 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) {
179 benchmark->RunOnLayer(this); 182 benchmark->RunOnLayer(this);
180 } 183 }
181 184
182 } // namespace cc 185 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_image_layer.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698