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

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

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « cc/layers/content_layer.h ('k') | cc/layers/heads_up_display_layer_impl.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 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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/content_layer.h" 5 #include "cc/layers/content_layer.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "cc/layers/content_layer_client.h" 10 #include "cc/layers/content_layer_client.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 SetTextureFormat( 107 SetTextureFormat(
108 layer_tree_host()->GetRendererCapabilities().best_texture_format); 108 layer_tree_host()->GetRendererCapabilities().best_texture_format);
109 } 109 }
110 110
111 void ContentLayer::SetContentsOpaque(bool opaque) { 111 void ContentLayer::SetContentsOpaque(bool opaque) {
112 Layer::SetContentsOpaque(opaque); 112 Layer::SetContentsOpaque(opaque);
113 if (updater_.get()) 113 if (updater_.get())
114 updater_->SetOpaque(opaque); 114 updater_->SetOpaque(opaque);
115 } 115 }
116 116
117 bool ContentLayer::SupportsLCDText() const {
118 return true;
119 }
120
117 skia::RefPtr<SkPicture> ContentLayer::GetPicture() const { 121 skia::RefPtr<SkPicture> ContentLayer::GetPicture() const {
118 if (!DrawsContent()) 122 if (!DrawsContent())
119 return skia::RefPtr<SkPicture>(); 123 return skia::RefPtr<SkPicture>();
120 124
121 int width = bounds().width(); 125 int width = bounds().width();
122 int height = bounds().height(); 126 int height = bounds().height();
123 127
124 SkPictureRecorder recorder; 128 SkPictureRecorder recorder;
125 SkCanvas* canvas = recorder.beginRecording(width, height, nullptr, 0); 129 SkCanvas* canvas = recorder.beginRecording(width, height, nullptr, 0);
126 client_->PaintContents(canvas, gfx::Rect(width, height), 130 client_->PaintContents(canvas, gfx::Rect(width, height),
127 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL); 131 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL);
128 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording()); 132 skia::RefPtr<SkPicture> picture = skia::AdoptRef(recorder.endRecording());
129 return picture; 133 return picture;
130 } 134 }
131 135
132 void ContentLayer::OnOutputSurfaceCreated() { 136 void ContentLayer::OnOutputSurfaceCreated() {
133 SetTextureFormat( 137 SetTextureFormat(
134 layer_tree_host()->GetRendererCapabilities().best_texture_format); 138 layer_tree_host()->GetRendererCapabilities().best_texture_format);
135 TiledLayer::OnOutputSurfaceCreated(); 139 TiledLayer::OnOutputSurfaceCreated();
136 } 140 }
137 141
138 } // namespace cc 142 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/content_layer.h ('k') | cc/layers/heads_up_display_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698