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

Unified Diff: cc/output/gl_renderer.cc

Issue 817673004: cc: TextureUploader - Reset GL_UNPACK_ALIGNMENT to 4 before uploading images. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bind context provider to current thread. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/resources/scoped_gpu_raster.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 2c1e3c87534441d4ca6cd72c6815638b38c5533f..9c856e86786c523939dff2e69ee49491000f99cb 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -27,6 +27,7 @@
#include "cc/quads/stream_video_draw_quad.h"
#include "cc/quads/texture_draw_quad.h"
#include "cc/resources/layer_quad.h"
+#include "cc/resources/scoped_gpu_raster.h"
#include "cc/resources/scoped_resource.h"
#include "cc/resources/texture_mailbox_deleter.h"
#include "gpu/GLES2/gl2extchromium.h"
@@ -158,7 +159,12 @@ class GLRenderer::ScopedUseGrContext {
return make_scoped_ptr(new ScopedUseGrContext(renderer, frame));
}
- ~ScopedUseGrContext() { PassControlToGLRenderer(); }
+ ~ScopedUseGrContext() {
+ // Pass context control back to GLrenderer.
+ scoped_gpu_raster_ = nullptr;
+ renderer_->RestoreGLState();
+ renderer_->RestoreFramebuffer(frame_);
+ }
GrContext* context() const {
return renderer_->output_surface_->context_provider()->GrContext();
@@ -166,17 +172,14 @@ class GLRenderer::ScopedUseGrContext {
private:
ScopedUseGrContext(GLRenderer* renderer, DrawingFrame* frame)
- : renderer_(renderer), frame_(frame) {
- PassControlToSkia();
- }
-
- void PassControlToSkia() { context()->resetContext(); }
-
- void PassControlToGLRenderer() {
- renderer_->RestoreGLState();
- renderer_->RestoreFramebuffer(frame_);
+ : scoped_gpu_raster_(
+ new ScopedGpuRaster(renderer->output_surface_->context_provider())),
+ renderer_(renderer),
+ frame_(frame) {
+ // scoped_gpu_raster_ passes context control to Skia.
}
+ scoped_ptr<ScopedGpuRaster> scoped_gpu_raster_;
GLRenderer* renderer_;
DrawingFrame* frame_;
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/resources/scoped_gpu_raster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698